Skip to content

Commit

Permalink
updated magento2 latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
amarpanday committed Jan 3, 2020
1 parent 7e32d8b commit c5ee086
Show file tree
Hide file tree
Showing 25 changed files with 362 additions and 266 deletions.
9 changes: 6 additions & 3 deletions Controller/Adminhtml/index/Ajax.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function execute()
}
}

if (isset($post['submitUpdateImport']) && $post['submitUpdateImport'] == 'Import Old Subscribers') {
if (isset($post['submitUpdateImport']) && !empty($post['submitUpdateImport'])) {
$model = $this->sibObject();
$listId = $model->getDbData('selected_list_data');
$model->sendAllMailIDToSendin($listId);
Expand Down Expand Up @@ -235,7 +235,7 @@ public function ajaxSmtpStatus()
$this->getResponse()->setBody($msgVal);
} else {
$model->updateDbData('api_smtp_status', 0);
$msgVal = __('Your SMTP account is not activated and therefore you can\'t use SendinBlue SMTP. For more informations, please contact our support to: [email protected]');
$msgVal = __('Your SMTP account is not activated and therefore you can\'t use Sendinblue SMTP. For more informations, please contact our support to: [email protected]');
$this->getResponse()->setHeader('Content-type', 'application/text');
$this->getResponse()->setBody($msgVal);
}
Expand Down Expand Up @@ -460,7 +460,9 @@ public function loadContact()
} else {
$imgSendinBlue = '<img src="'.$blockObj->getViewFileUrl('Sendinblue_Sendinblue::images/disabled.gif').'" id="ajax_contact_status_'.$i.'" title="'.$title2.'" >';
}

$imgMagento = str_replace('_view','Magento/backend', $imgMagento);
$imgSendinBlue = str_replace('_view','Magento/backend', $imgSendinBlue);
$imgSms = str_replace('_view','Magento/backend', $imgSms);
$message .= '<tr class="even pointer"><td class="a-left">'.$email.'</td><td class="a-left">'.$client.'</td><td class="a-left">'.$phone.'</td><td class="a-left">'.$imgMagento.'</td>
<td class="a-left"><a status="'.$showStatus.'" email="'.$email.'" class="ajax_contacts_href" href="javascript:void(0)">
'.$imgSendinBlue.'</a></td><td class="a-left last">
Expand Down Expand Up @@ -635,3 +637,4 @@ public function subsUnsubsContact()
}
}
}

15 changes: 8 additions & 7 deletions Controller/Adminhtml/index/Post.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function execute()
}
try {
$model = $this->sibObject();
if (isset($post['submitUpdate']) && $post['submitUpdate'] == 'Update') {
if (isset($post['submitUpdate']) && !empty($post['submitUpdate'])) {
$this->apiKeyPostProcessConfiguration();
}

Expand All @@ -52,17 +52,17 @@ public function execute()
}
}
//save value for notify email
if (isset($post['notify_sms_mail']) && $post['notify_sms_mail'] == 'Save') {
if (isset($post['notify_sms_mail']) && !empty($post['notify_sms_mail'])) {
$this->saveNotifyValue();
}

//save order sms send and body details
if (isset($post['sender_order_save']) && $post['sender_order_save'] == 'Save') {
if (isset($post['sender_order_save']) && !empty($post['sender_order_save'])) {
$this->saveOrderSms();
}

//save shipped sms send and body details
if (isset($post['sender_shipment_save']) && $post['sender_shipment_save'] == 'Save') {
if (isset($post['sender_shipment_save']) && !empty($post['sender_shipment_save'])) {
$this->saveShippedSms();
}

Expand All @@ -86,13 +86,13 @@ public function execute()
* Description: send test email if smtp setup well.
*
*/
if (isset($post['sendTestMail']) && $post['sendTestMail'] == 'Send') {
if (isset($post['sendTestMail']) && !empty($post['sendTestMail'])) {
$post = $this->getRequest()->getPostValue();
$userEmail = !empty($post['testEmail']) ? $post['testEmail'] : '';
$relayData = $model->getDbData('relay_data_status');
if (!empty($userEmail) && $post['smtpservices'] == 1) {
if ($relayData == 'enabled') {
$title = __('[SendinBlue SMTP] test email');
$title = __('[Sendinblue SMTP] test email');
$tempName = 'sendinsmtp_conf';
$respMail = $model->smtpSendMail($userEmail, $title, $tempName, $paramVal = '');
if ($respMail['status'] == 1) {
Expand All @@ -105,7 +105,7 @@ public function execute()
return;
}
} else {
$this->messageManager->addError(__('Your SMTP account is not activated and therefore you can\'t use SendinBlue SMTP. For more informations, Please contact our support to: [email protected]'));
$this->messageManager->addError(__('Your SMTP account is not activated and therefore you can\'t use Sendinblue SMTP. For more informations, Please contact our support to: [email protected]'));
$this->_redirect('sendinblue/sib/index');
return;
}
Expand Down Expand Up @@ -365,3 +365,4 @@ public function sendSmsCampaign()
}
}
}

Empty file modified Controller/Adminhtml/index/Sync.php
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion Controller/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function dubleoptinProcess($userEmail)
$mailin = $this->_model->createObjMailin($apiKey);

$data = array( "email" => $userEmail,
"attributes" => array(),
"attributes" => array("DOUBLE_OPT-IN"=>1),
"blacklisted" => 0,
"listid" => array($listId),
"listid_unlink" => array($optinListId),
Expand Down
50 changes: 25 additions & 25 deletions Model/Mmailin.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public function getCampaignsV2($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_field: This is to personalize the «To» Field. If you want to
include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact
attributes here, these should already exist in SendinBlue account [Optional]
attributes here, these should already exist in Sendinblue account [Optional]
@options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
@options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
@options data {Integer} inline_image: Status of inline image. Possible values = 0 (default)
Expand Down Expand Up @@ -254,7 +254,7 @@ public function createCampaign($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_field: This is to personalize the «To» Field. If you want to
include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the
contact attributes here, these should already exist in SendinBlue account [Optional]
contact attributes here, these should already exist in Sendinblue account [Optional]
@options data {Array} exclude_list: These are the lists which must be excluded from the
campaign [Optional]
@options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
Expand Down Expand Up @@ -393,7 +393,7 @@ public function updateCampaignStatus($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_field: This is to personalize the «To» Field. If you want to include
the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes
here, these should already exist in SendinBlue account [Optional]
here, these should already exist in Sendinblue account [Optional]
@options data {Array} exclude_list: These are the lists which must be excluded from the campaign
[Optional]
@options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1.
Expand Down Expand Up @@ -439,7 +439,7 @@ public function createTriggerCampaign($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_field: This is to personalize the «To» Field. If you want to include the
first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here
, these should already exist in SendinBlue account [Optional]
, these should already exist in Sendinblue account [Optional]
@options data {Array} exclude_list: These are the lists which must be excluded from the campaign
[Optional]
@options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1.
Expand Down Expand Up @@ -594,11 +594,11 @@ public function displayListUsers($data)
}

/*
Add already existing users in the SendinBlue contacts to the list.
Add already existing users in the Sendinblue contacts to the list.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of list to link users in it [Mandatory]
@options data {Array} users: Email address of the already existing user(s) in the
SendinBlue contacts. Example: "[email protected]". You can use commas to separate multiple
Sendinblue contacts. Example: "[email protected]". You can use commas to separate multiple
users [Mandatory]
*/

Expand All @@ -610,11 +610,11 @@ public function addUsersList($data)
}

/*
Delete already existing users in the SendinBlue contacts from the list.
Delete already existing users in the Sendinblue contacts from the list.
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of list to unlink users from it [Mandatory]
@options data {Array} users: Email address of the already existing user(s) in the
SendinBlue contacts to be modified. Example: "[email protected]". You can use commas
Sendinblue contacts to be modified. Example: "[email protected]". You can use commas
to separate multiple users [Mandatory]
*/
public function deleteUsersList($data)
Expand Down Expand Up @@ -650,7 +650,7 @@ public function getAttribute($data)
@options data {String} type: Type of attribute. Possible values – normal, transactional,
category, calculated & global ( case sensitive ) [Mandatory]
@options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute
to be created in your SendinBlue account. It should be sent as an associative array. Example:
to be created in your Sendinblue account. It should be sent as an associative array. Example:
array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′).
The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string.
Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2",
Expand All @@ -675,11 +675,11 @@ public function deleteAttribute($type, $data)

/*
Create a new user if an email provided as input, doesn’t exists in the contact list
of your SendinBlue account, otherwise it will update the existing user.
of your Sendinblue account, otherwise it will update the existing user.
@param {Array} data contains php array with key value pair.
@options data {String} email: Email address of the user to be created in SendinBlue contacts.
Already existing email address of user in the SendinBlue contacts to be modified [Mandatory]
@options data {Array} attributes: The name of attribute present in your SendinBlue account.
@options data {String} email: Email address of the user to be created in Sendinblue contacts.
Already existing email address of user in the Sendinblue contacts to be modified [Mandatory]
@options data {Array} attributes: The name of attribute present in your Sendinblue account.
It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas
to separate multiple attributes [Optional]
@options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible
Expand All @@ -698,7 +698,7 @@ public function createUpdateUser($data)
/*
Get Access a specific user Information.
@param {Array} data contains php array with key value pair.
@options data {String} email: Email address of the already existing user in the SendinBlue
@options data {String} email: Email address of the already existing user in the Sendinblue
contacts [Mandatory]
*/
public function getUser($data)
Expand All @@ -709,7 +709,7 @@ public function getUser($data)
/*
Unlink existing user from all lists.
@param {Array} data contains php array with key value pair.
@options data {String} email: Email address of the already existing user in the SendinBlue
@options data {String} email: Email address of the already existing user in the Sendinblue
contacts to be unlinked from all lists [Mandatory]
*/
public function deleteUser($data)
Expand Down Expand Up @@ -743,7 +743,7 @@ public function importUsers($data)
/*
Export Users Information.
@param {Array} data contains php array with key value pair.
@options data {String} export_attrib: The name of attribute present in your SendinBlue account.
@options data {String} export_attrib: The name of attribute present in your Sendinblue account.
You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional]
@options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}",
will export all blacklisted users [Mandatory]
Expand Down Expand Up @@ -934,7 +934,7 @@ public function sendEmail($data)
}

/*
Aggregate / date-wise report of the SendinBlue SMTP account.
Aggregate / date-wise report of the Sendinblue SMTP account.
@param {Array} data contains php array with key value pair.
@options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals.
Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per
Expand Down Expand Up @@ -990,15 +990,15 @@ public function deleteBounces($data)
}

/*
Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
Send templates created on Sendinblue, through Sendinblue SMTP (transactional mails).
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
@options data {Integer} id: Id of the template created on Sendinblue account [Mandatory]
@options data {String} to: Email address of the recipient(s). You can use pipe ( | )
to separate multiple recipients. Example: "[email protected]|[email protected]"
[Mandatory]
@options data {String} cc: Same as to but for Cc [Optional]
@options data {String} bcc: Same as to but for Bcc [Optional]
@options data {Array} attrv The name of attribute present in your SendinBlue account. It should
@options data {Array} attrv The name of attribute present in your Sendinblue account. It should
be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate
multiple attributes [Optional]
@options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed
Expand Down Expand Up @@ -1030,7 +1030,7 @@ public function sendTransactionalTemplate($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_fieldv This is to personalize the «To» Field. If you want to include
the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes
here, these should already exist in SendinBlue account [Optional]
here, these should already exist in Sendinblue account [Optional]
@options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0
means template is inactive, & status = 1 means template is active [Optional]
@options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1.
Expand Down Expand Up @@ -1060,7 +1060,7 @@ public function createTemplate($data)
@options data {String} reply_to: The reply to email in the campaign emails [Optional]
@options data {String} to_field: This is to personalize the «To» Field. If you want to include the
first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here,
these should already exist in SendinBlue account [Optional]
these should already exist in Sendinblue account [Optional]
@options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0
means template is inactive, & status = 1 means template is active [Optional]
@options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1.
Expand Down Expand Up @@ -1103,7 +1103,7 @@ public function sendSms($data)
@options data {String} content: Content of the message. The maximum characters used per SMS is 160,
if used more than that, it will be counted as more than one SMS [Optional]
@options data {String} bat: Mobile number with the country code to send test SMS. The mobile number
defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted
defined here should belong to one of your contacts in Sendinblue account and should not be blacklisted
[Optional]
@options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if
scheduled_date is not empty]
Expand All @@ -1129,7 +1129,7 @@ public function createSmsCampaign($data)
@options data {String} content: Content of the message. The maximum characters used per SMS is 160,
if used more than that, it will be counted as more than one SMS [Optional]
@options data {String} bat: Mobile number with the country code to send test SMS. The mobile number
defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted
defined here should belong to one of your contacts in Sendinblue account and should not be blacklisted
[Optional]
@options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if
scheduled_date is not empty]
Expand All @@ -1152,7 +1152,7 @@ public function updateSmsCampaign($data)
@param {Array} data contains php array with key value pair.
@options data {Integer} id: Id of the SMS campaign [Mandatory]
@options data {String} to: Mobile number with the country code to send test SMS. The mobile
number defined here should belong to one of your contacts in SendinBlue account and should not be
number defined here should belong to one of your contacts in Sendinblue account and should not be
blacklisted [Mandatory]
*/
public function sendBatSms($data)
Expand Down
Loading

0 comments on commit c5ee086

Please sign in to comment.