Skip to content

Commit

Permalink
Merge branch '2.4-develop' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacker committed Apr 19, 2022
2 parents 6043fca + 9d831be commit e1936be
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Model/Resolver/Bestsellers/Bestsellers.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,15 @@ public function __construct(
*/
public function resolve(Field $field, $context, ResolveInfo $info, array $value = null, array $args = null)
{
if (!$this->helperData->isEnabled()) {
throw new GraphQlInputException(__('Smtp is disabled.'));
if (!$this->helperEmailMarketing->isEnableEmailMarketing()) {
throw new GraphQlInputException(__('Marketing automation is disabled.'));
}

$appId = $args['app_id'];
$secretKey = $args['secret_key'];
if (!($this->helperEmailMarketing->getAppID() === $appId &&
$this->helperEmailMarketing->getSecretKey() === $secretKey)) {
throw new GraphQlInputException(__('Invalid app id or secret key.'));
}

$filters = $args['filters'];
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"mageplaza/module-core": "^1.4.11"
},
"type": "magento2-module",
"version": "4.7.0",
"version": "4.7.1",
"license": "proprietary",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# @license https://www.mageplaza.com/LICENSE.txt

type Query {
mpSmtpBestsellers (filters: MpFilters): SmtpBestsellersOutput @resolver(class: "Mageplaza\\Smtp\\Model\\Resolver\\Bestsellers\\Bestsellers") @doc(description: "Searches for Best Sellers information matches the filter.")
mpSmtpBestsellers (app_id: String!,secret_key: String!,filters: MpFilters): SmtpBestsellersOutput @resolver(class: "Mageplaza\\Smtp\\Model\\Resolver\\Bestsellers\\Bestsellers") @doc(description: "Searches for Best Sellers information matches the filter.")
}

input MpFilters {
Expand Down
2 changes: 2 additions & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,5 @@ Bcc,Bcc
"Smtp is disabled.","Smtp is disabled."
"From and To fields are required.","From and To fields are required."
"The store with store ID is %d doesn't exist.","The store with store ID is %d doesn't exist."
"Marketing automation is disabled.","Marketing automation is disabled."
"Invalid app id or secret key.","Invalid app id or secret key."

0 comments on commit e1936be

Please sign in to comment.