diff --git a/Controller/Adminhtml/index/Ajax.php b/Controller/Adminhtml/index/Ajax.php
old mode 100755
new mode 100644
index fbc0198..57150e5
--- a/Controller/Adminhtml/index/Ajax.php
+++ b/Controller/Adminhtml/index/Ajax.php
@@ -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);
@@ -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: contact@sendinblue.com');
+ $msgVal = __('Your SMTP account is not activated and therefore you can\'t use Sendinblue SMTP. For more informations, please contact our support to: contact@sendinblue.com');
$this->getResponse()->setHeader('Content-type', 'application/text');
$this->getResponse()->setBody($msgVal);
}
@@ -460,7 +460,9 @@ public function loadContact()
} else {
$imgSendinBlue = '';
}
-
+ $imgMagento = str_replace('_view','Magento/backend', $imgMagento);
+ $imgSendinBlue = str_replace('_view','Magento/backend', $imgSendinBlue);
+ $imgSms = str_replace('_view','Magento/backend', $imgSms);
$message .= '
@@ -635,3 +637,4 @@ public function subsUnsubsContact()
}
}
}
+
diff --git a/Controller/Adminhtml/index/Post.php b/Controller/Adminhtml/index/Post.php
old mode 100755
new mode 100644
index b163b2b..329a185
--- a/Controller/Adminhtml/index/Post.php
+++ b/Controller/Adminhtml/index/Post.php
@@ -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();
}
@@ -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();
}
@@ -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) {
@@ -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: contact@sendinblue.com'));
+ $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: contact@sendinblue.com'));
$this->_redirect('sendinblue/sib/index');
return;
}
@@ -365,3 +365,4 @@ public function sendSmsCampaign()
}
}
}
+
diff --git a/Controller/Adminhtml/index/Sync.php b/Controller/Adminhtml/index/Sync.php
old mode 100755
new mode 100644
diff --git a/Controller/Index/Index.php b/Controller/Index/Index.php
index 3a09c89..8b4ea10 100644
--- a/Controller/Index/Index.php
+++ b/Controller/Index/Index.php
@@ -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),
diff --git a/Model/Mmailin.php b/Model/Mmailin.php
index 50f464e..0a432b0 100644
--- a/Model/Mmailin.php
+++ b/Model/Mmailin.php
@@ -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)
@@ -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]
@@ -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.
@@ -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.
@@ -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: "test@example.net". You can use commas to separate multiple
+ Sendinblue contacts. Example: "test@example.net". You can use commas to separate multiple
users [Mandatory]
*/
@@ -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: "test@example.net". You can use commas
+ Sendinblue contacts to be modified. Example: "test@example.net". You can use commas
to separate multiple users [Mandatory]
*/
public function deleteUsersList($data)
@@ -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",
@@ -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
@@ -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)
@@ -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)
@@ -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]
@@ -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
@@ -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: "to-example@example.net|to2-example@example.net"
[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
@@ -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.
@@ -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.
@@ -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]
@@ -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]
@@ -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)
diff --git a/Model/SendinblueSib.php b/Model/SendinblueSib.php
index d3b545c..2d304f9 100644
--- a/Model/SendinblueSib.php
+++ b/Model/SendinblueSib.php
@@ -87,9 +87,9 @@ public function createFolderName($apiKey)
$folderId = $result['key'];
$existList = $result['list_name'];
}
- //Create the partner's name i.e. Shopify on SendinBlue platform
+ //Create the partner's name i.e. Shopify on Sendinblue platform
$this->partnerMagento();
- // create list in SendinBlue
+ // create list in Sendinblue
$this->createNewList($folderId, $existList);
}
@@ -106,7 +106,7 @@ public function partnerMagento()
}
/**
- * Description: Creates a list by the name "Shopify" on user's SendinBlue account.
+ * Description: Creates a list by the name "Shopify" on user's Sendinblue account.
*
* @author: Amar Pandey
* @param: useremail, doubleoptinUrl, storeId ,shoplang
@@ -129,9 +129,6 @@ public function createNewList($response, $existList)
);
$listResp = $mailin->createList($data);
$this->_resourceConfig->saveConfig('sendinblue/selected_list_data', trim($listResp['data']['id']), $this->_scopeTypeDefault, $this->_storeId);
- //list id
-
- $this->sendAllMailIDToSendin($listResp['data']['id']);
}
@@ -225,7 +222,7 @@ public function resetDataBaseValue()
/**
* Description: reate Normal, Transactional, Calculated and Global attributes and their values
- * on SendinBlue platform. This is necessary for the Shopify to add subscriber's details.
+ * on Sendinblue platform. This is necessary for the Shopify to add subscriber's details.
*
* @author: Amar Pandey
* @param: no
@@ -321,7 +318,7 @@ public function allTransactionalAttributes()
}
/**
- * Description: API config value from SendinBlue with date format.
+ * Description: API config value from Sendinblue with date format.
*
* @author: Amar Pandey
* @param: storeID
@@ -390,7 +387,7 @@ public function checkFolderList()
/**
* Description: Method is used to send all the subscribers from Shopify to
- * SendinBlue for adding / updating purpose.
+ * Sendinblue for adding / updating purpose.
*
* @author: Amar Pandey
* @param: Sib listId
@@ -400,7 +397,8 @@ public function checkFolderList()
public function sendAllMailIDToSendin($listId)
{
$emailValue = $this->getSubscribeCustomer();
- $baseUrl = $this->_storeManagerInterface->getStore()->getBaseUrl();
+ $mediaUrl = $this->_storeManagerInterface->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
+ $fileName = $this->getDbData('sendin_csv_file_name');
$apiKey = !empty($this->apiKey) ? $this->apiKey : $this->getDbData('api_key');
if ($emailValue > 0 && !empty($apiKey)) {
$this->updateDbData('import_old_user_status', 1);
@@ -408,7 +406,7 @@ public function sendAllMailIDToSendin($listId)
$listIdVal = explode('|', $listId);
$mailinObj = $this->createObjMailin($apiKey);
$userDataInformation['key'] = $apiKey;
- $userDataInformation['url'] = $baseUrl.'pub/media/sendinblue_csv/ImportSubUsersToSendinblue.csv';
+ $userDataInformation['url'] = $mediaUrl.'sendinblue_csv/'.$fileName.'.csv';
$userDataInformation['listids'] = $listIdVal; // $list;
$userDataInformation['notify_url'] = '';
$responseValue = $mailinObj->importUsers($userDataInformation);
@@ -422,7 +420,7 @@ public function sendAllMailIDToSendin($listId)
}
/**
- * Description: Fetches all the subscribers of Shopify and adds them to the SendinBlue database.
+ * Description: Fetches all the subscribers of Shopify and adds them to the Sendinblue database.
*
* @author: Amar Pandey
* @param: get user detail
@@ -495,8 +493,9 @@ public function getSubscribeCustomer()
if (!is_dir($this->_dir->getPath('media').'/sendinblue_csv')) {
mkdir($this->_dir->getPath('media').'/sendinblue_csv', 0777, true);
}
-
- $handle = fopen($this->_dir->getPath('media').'/sendinblue_csv/ImportSubUsersToSendinblue.csv', 'w+');
+ $fileName = rand();
+ $this->updateDbData('sendin_csv_file_name', $fileName);
+ $handle = fopen($this->_dir->getPath('media').'/sendinblue_csv/'.$fileName.'.csv', 'w+');
$keyValue = array_keys($attributesName);
array_splice($keyValue, 0, 0, 'EMAIL');
fwrite($handle, implode(';', $keyValue)."\n");
@@ -641,7 +640,7 @@ public function templateDisplay($apiKey = false)
}
/**
- * Description: Show SMS credit from SendinBlue.
+ * Description: Show SMS credit from Sendinblue.
*
* @author: Amar Pandey
* @param: ApiKey
@@ -772,7 +771,9 @@ public function importOrderhistory()
mkdir($this->_dir->getPath('media').'/sendinblue_csv', 0777, true);
}
- $handle = fopen($this->_dir->getPath('media').'/sendinblue_csv/ImportOldOrdersToSendinblue.csv', 'w+');
+ $fileName = rand();
+ $this->updateDbData('sendin_csv_file_name', $fileName);
+ $handle = fopen($this->_dir->getPath('media').'/sendinblue_csv/'.$fileName.'.csv', 'w+');
fwrite($handle, 'EMAIL;ORDER_ID;ORDER_PRICE;ORDER_DATE'.PHP_EOL);
$collection = $this->getCollection();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
@@ -813,9 +814,10 @@ public function importOrderhistory()
$userDataInformation = array();
$listIdVal = explode('|', $listId);
$mailinObj = $this->createObjMailin($apiKey);
- $baseUrl = $this->_storeManagerInterface->getStore()->getBaseUrl();
+ $baseUrl = $this->_storeManagerInterface->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
+ $fileName = $this->getDbData('sendin_csv_file_name');
$userDataInformation['key'] = $apiKey;
- $userDataInformation['url'] = $baseUrl.'pub/media/sendinblue_csv/ImportOldOrdersToSendinblue.csv';
+ $userDataInformation['url'] = $baseUrl.'sendinblue_csv/'.$fileName.'.csv';
$userDataInformation['listids'] = $listIdVal; // $list;
$userDataInformation['notify_url'] = '';
$responseValue = $mailinObj->importUsers($userDataInformation);
@@ -953,7 +955,7 @@ public function sendCampaignTestSms($sender, $message, $number)
}
/**
- * Description: Send SMS from SendinBlue.
+ * Description: Send SMS from Sendinblue.
* Get Param sender and msg fields.
*/
public function sendSmsApi($dataSms)
@@ -964,7 +966,9 @@ public function sendSmsApi($dataSms)
$dataFinal = array( "to" => trim($dataSms['to']),
"from" => trim($dataSms['from']),
"text" => trim($dataSms['text']),
- "type" => trim($dataSms['type'])
+ "type" => trim($dataSms['type']),
+ "source" => 'api',
+ "plugin" => 'magento2-plugin'
);
$dataResp = $mailin->sendSms($dataFinal);
@@ -1106,7 +1110,7 @@ public function multipleChoiceCampaign($post)
}
/**
- * Description: Send single user in SendinBlue.
+ * Description: Send single user in Sendinblue.
*
*/
public function subscribeByruntime($userEmail, $updateDataInSib)
@@ -1118,11 +1122,11 @@ public function subscribeByruntime($userEmail, $updateDataInSib)
$sendinConfirmType = $this->getDbData('confirm_type');
if ($sendinConfirmType === 'doubleoptin') {
$listId = $this->getDbData('optin_list_id');
+ $updateDataInSib['DOUBLE_OPT-IN'] = 2;
} else {
$listId = $this->getDbData('selected_list_data');
}
-
$apiKey = trim($this->getDbData('api_key'));
if (!empty($apiKey)) {
$mailin = $this->createObjMailin($apiKey);
@@ -1140,7 +1144,7 @@ public function subscribeByruntime($userEmail, $updateDataInSib)
}
/**
- * Description: Checks whether the SendinBlue API key and the SendinBlue subscription form is enabled
+ * Description: Checks whether the Sendinblue API key and the Sendinblue subscription form is enabled
* and returns the true|false accordingly.
*/
public function syncSetting()
@@ -1155,7 +1159,7 @@ public function syncSetting()
}
/**
- * Description: Send single user in SendinBlue.
+ * Description: Send single user in Sendinblue.
*
*/
public function unsubscribeByruntime($userEmail)
@@ -1230,6 +1234,7 @@ public function smtpSendMail($userEmail, $title, $tempName, $paramVal)
$lang = $this->getDbData('sendin_config_lang');
$path = $this->_blocktemp->getViewFileUrl('Sendinblue_Sendinblue::email_temp/'.strtolower($lang).'/'.$tempName.'.html');
+ $path = str_replace('_view','Magento/backend', $path);
$bodyContent = file_get_contents($path);
if (!empty($paramVal)) {
foreach($paramVal as $key=>$replaceVal) {
@@ -1254,7 +1259,7 @@ public function sendNotifySms($remainingSms)
{
$notifyEmail = $this->getDbData('notify_email');
$tempName = 'sendin_notification';
- $title = __('[SendinBlue] Notification : Credits SMS');
+ $title = __('[Sendinblue] Notification : Credits SMS');
$siteName = $this->_storeManagerInterface->getStore()->getName();
$paramVal = array('{present_credit}' => $remainingSms, '{site_name}' => $siteName);
$this->smtpSendMail($notifyEmail, $title, $tempName, $paramVal);
@@ -1326,11 +1331,17 @@ public function sendWsTemplateMail($to)
$to = array($to => '');
$from = array($senderEmail, $senderName);
+ $searchValue = "({{\s*doubleoptin\s*}})";
$htmlContent = str_replace('{title}', $subject, $htmlContent);
$htmlContent = str_replace('https://[DOUBLEOPTIN]', '{subscribe_url}', $htmlContent);
$htmlContent = str_replace('http://[DOUBLEOPTIN]', '{subscribe_url}', $htmlContent);
+ $htmlContent = str_replace('https://{{doubleoptin}}', '{subscribe_url}', $htmlContent);
+ $htmlContent = str_replace('http://{{doubleoptin}}', '{subscribe_url}', $htmlContent);
+ $htmlContent = str_replace('https://{{ doubleoptin }}', '{subscribe_url}', $htmlContent);
+ $htmlContent = str_replace('http://{{ doubleoptin }}', '{subscribe_url}', $htmlContent);
$htmlContent = str_replace('[DOUBLEOPTIN]', '{subscribe_url}', $htmlContent);
+ $htmlContent = preg_replace($searchValue, '{subscribe_url}', $htmlContent);
$htmlContent = str_replace('{site_name}', $siteName, $htmlContent);
$htmlContent = str_replace('{unsubscribe_url}', $pathResp, $htmlContent);
$htmlContent = str_replace('{subscribe_url}', $pathResp, $htmlContent);
@@ -1517,9 +1528,13 @@ public function getNewsletterUnSubscribeCount()
*/
public function checkPortStatus()
{
- $relay_port_status = @fsockopen('smtp-relay.sendinblue.com', 587);
- if (!$relay_port_status) {
- return 0;
+ try {
+ $relay_port_status = fsockopen(‘smtp-relay.sendinblue.com’, 587);
+ if (!$relay_port_status) {
+ return 0;
+ }
+ } catch (\Exception $e) {
+ return 1;
}
}
diff --git a/Model/Transport.php b/Model/Transport.php
index d25af5d..0a500da 100644
--- a/Model/Transport.php
+++ b/Model/Transport.php
@@ -4,50 +4,96 @@
*/
namespace Sendinblue\Sendinblue\Model;
-class Transport extends \Zend_Mail_Transport_Smtp implements \Magento\Framework\Mail\TransportInterface
+use Magento\Framework\App\Config\ScopeConfigInterface;
+use Magento\Framework\Exception\MailException;
+use Magento\Framework\Mail\MessageInterface;
+use Magento\Framework\Mail\EmailMessageInterface;
+use Magento\Framework\Mail\EmailMessage;
+use Zend\Mail\Message;
+use Magento\Framework\Mail\TransportInterface;
+use Magento\Framework\Phrase;
+use Magento\Store\Model\ScopeInterface;
+use Zend\Mail\Transport\Sendmail;
+use Zend\Mail\Transport\SmtpOptions;
+use Zend\Mail\Transport\Smtp;
+use Magento\Framework\App\ObjectManager;
+
+class Transport implements TransportInterface
{
- /**
- * @var \Magento\Framework\Mail\MessageInterface
- */
+ /** @var MessageInterface */
protected $_message;
- public $scopeConfig;
+
+ protected $_scopeConfig;
+ protected $_magVersion;
+
+
+ /** @var Smtp|\Zend_Mail_Transport_Smtp **/
+ protected $transport;
+
+
/**
* @param MessageInterface $message
* @param null $parameters
* @throws \InvalidArgumentException
*/
- public function __construct(\Magento\Framework\Mail\MessageInterface $message,
- \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
- )
- {
- if (!$message instanceof \Zend_Mail) {
- throw new \InvalidArgumentException('The message should be an instance of \Zend_Mail');
+ public function __construct($message = null, ScopeConfigInterface $scopeConfig, $parameters = null ){
+
+ $magVersion = $scopeConfig->getValue('sendinblue/mag_version_sib', 'default');
+
+ if (empty($magVersion)) {
+ $objectManager = ObjectManager::getInstance();
+ $productMetadata = $objectManager->get('Magento\Framework\App\ProductMetadataInterface');
+ $coreConfigObj = $objectManager->get('Magento\Framework\App\Config\ConfigResource\ConfigInterface');
+ $magVersionSib = $productMetadata->getVersion();
+ $coreConfigObj->saveConfig('sendinblue/mag_version_sib', $magVersionSib, 'default', 0);
+ $magVersion = $scopeConfig->getValue('sendinblue/mag_version_sib', 'default');
}
- $smtpHost = '';
- $smtpConf = array();
- $relaySib = $scopeConfig->getValue('sendinblue/relay_data_status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ $this->_magVersion = $magVersion;
+ $this->_message = $message;
+ $this->_scopeConfig = $scopeConfig;
+ $relaySib = $scopeConfig->getValue('sendinblue/relay_data_status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if ($relaySib == 'enabled') {
- $smtpHost = $scopeConfig->getValue('sendinblue/smtp_host', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
+ $smtpHost = "smtp-relay.sendinblue.com";
$smtpAuthentication = $scopeConfig->getValue('sendinblue/smtp_authentication', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$smtpTls = $scopeConfig->getValue('sendinblue/smtp_tls', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$smtpPort = $scopeConfig->getValue('sendinblue/smtp_port', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$smtpUsername = $scopeConfig->getValue('sendinblue/smtp_username', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
$smtpPassword = $scopeConfig->getValue('sendinblue/smtp_password', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
- $smtpConf = [
- 'auth' => $smtpAuthentication,
- 'tls' => $smtpTls,
- 'port' => $smtpPort,
- 'username' => $smtpUsername,
- 'password' => $smtpPassword
- ];
-
+ if ($this->_magVersion >= '2.3.3' && $message instanceof EmailMessage) {
+ $this->transport = new Smtp( new SmtpOptions([
+ 'host' => $smtpHost,
+ 'port' => $smtpPort,
+ 'connection_class' => $smtpAuthentication,
+ 'connection_config' => [
+ 'username' => $smtpUsername,
+ 'password' => $smtpPassword,
+ 'ssl' => $smtpTls,
+ ],
+ ]));
+ } elseif ($this->_magVersion <= '2.2.0' && $message instanceof \Zend_mail) {
+ $this->transport = new \Zend_Mail_Transport_Smtp($smtpHost, [
+ 'auth' => $smtpAuthentication,
+ 'tls' => $smtpTls,
+ 'port' => $smtpPort,
+ 'username' => $smtpUsername,
+ 'password' => $smtpPassword
+ ]);
+ } elseif ($this->_magVersion <= '2.3.2' && $message instanceof MessageInterface) {
+ $this->transport = new Smtp( new SmtpOptions([
+ 'host' => $smtpHost,
+ 'port' => $smtpPort,
+ 'connection_class' => $smtpAuthentication,
+ 'connection_config' => [
+ 'username' => $smtpUsername,
+ 'password' => $smtpPassword,
+ 'ssl' => $smtpTls,
+ ],
+ ]));
+ }
}
- parent::__construct($smtpHost, $smtpConf);
- $this->_message = $message;
-
}
/**
@@ -57,11 +103,29 @@ public function __construct(\Magento\Framework\Mail\MessageInterface $message,
*/
public function sendMessage()
{
- try {
- parent::send($this->_message);
- } catch (\Exception $e) {
- throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
+ if ($this->_scopeConfig->isSetFlag('system/smtp/disable',\Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
+ return false;
}
+
+ if(null !== $this->transport) {
+ try {
+ if ( $this->_magVersion >= '2.3.3' && $this->_message instanceof EmailMessage) {
+ $zend_mail = Message::fromString($this->_message->getRawMessage());
+ $subject = $zend_mail->getSubject();
+ $zend_mail->setSubject(htmlspecialchars_decode((string)$subject, ENT_QUOTES));
+ $this->transport->send($zend_mail);
+ } elseif ( $this->_magVersion <= '2.2.0' && $this->_message instanceof \Zend_mail) {
+ $this->transport->send($this->_message);
+ } elseif ($this->_magVersion <= '2.3.2' && $this->_message instanceof MessageInterface) {
+ $zend_mail = Message::fromString($this->_message->getRawMessage());
+ $subject = $zend_mail->getSubject();
+ $zend_mail->setSubject(htmlspecialchars_decode((string)$subject, ENT_QUOTES));
+ $this->transport->send($zend_mail);
+ }
+ } catch (\Exception $e) {
+ throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
+ }
+ }
}
/**
diff --git a/Observer/SibNlObserver.php b/Observer/SibNlObserver.php
old mode 100755
new mode 100644
diff --git a/Observer/SibObserver.php b/Observer/SibObserver.php
old mode 100755
new mode 100644
diff --git a/Observer/SibOrderObserver.php b/Observer/SibOrderObserver.php
old mode 100755
new mode 100644
diff --git a/Observer/SibShipObserver.php b/Observer/SibShipObserver.php
old mode 100755
new mode 100644
diff --git a/Observer/SibaddrObserver.php b/Observer/SibaddrObserver.php
old mode 100755
new mode 100644
diff --git a/README.md b/README.md
index 9921fd7..361c189 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,8 @@
Blog module allows you to create a full-fledged blog on your [Magento 2](http://magento.com/) Store.
## Features
- * With the SendinBlue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.
- * Synchronize your subscribers with SendinBlue (subscribed and unsubscribed contacts)
+ * With the Sendinblue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.
+ * Synchronize your subscribers with Sendinblue (subscribed and unsubscribed contacts)
* Easily create good looking emailings
* Schedule your campaigns
* Track your results and optimize
diff --git a/composer.json b/composer.json
index fbf40be..3b6c63d 100644
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "sendinblue/module-sendinblue",
"description": "N/A",
"type": "magento2-module",
- "version": "2.0.2",
+ "version": "2.0.6",
"license": [
"OSL-3.0",
"AFL-3.0"
diff --git a/etc/di.xml b/etc/di.xml
index dc6f48f..b106845 100644
--- a/etc/di.xml
+++ b/etc/di.xml
@@ -2,4 +2,5 @@
+
diff --git a/etc/module.xml b/etc/module.xml
index 382111c..c876352 100644
--- a/etc/module.xml
+++ b/etc/module.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/i18n/en_US.csv b/i18n/en_US.csv
index 5ea374f..47fece4 100644
--- a/i18n/en_US.csv
+++ b/i18n/en_US.csv
@@ -1,50 +1,50 @@
-"SendinBlue : THE all-in-one plugin for your marketing and transactional emails.","SendinBlue : THE all-in-one plugin for your marketing and transactional emails."
-"About SendinBlue","About SendinBlue"
+"Sendinblue : THE all-in-one plugin for your marketing and transactional emails.","Sendinblue : THE all-in-one plugin for your marketing and transactional emails."
+"About Sendinblue","About Sendinblue"
"For further informations, please visit our website","For further informations, please visit our website"
-"With the SendinBlue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.","With the SendinBlue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers."
-"Synchronize your subscribers with SendinBlue (subscribed contacts)","Synchronize your subscribers with SendinBlue (subscribed contacts)"
+"With the Sendinblue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.","With the Sendinblue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers."
+"Synchronize your subscribers with Sendinblue (subscribed contacts)","Synchronize your subscribers with Sendinblue (subscribed contacts)"
"Easily create good looking emailings","Easily create good looking emailings"
"Schedule your campaigns","Schedule your campaigns"
"Track your results and optimize","Track your results and optimize"
"Monitor your transactional emails (purchase confirmation, password reset, etc) with a better deliverability and real-time analytics","Monitor your transactional emails (purchase confirmation, password reset, etc) with a better deliverability and real-time analytics"
-"Why should you use SendinBlue ?","Why should you use SendinBlue ?"
+"Why should you use Sendinblue ?","Why should you use Sendinblue ?"
"Optimized deliverability","Optimized deliverability"
"Unbeatable pricing – best value in the industry","Unbeatable pricing – best value in the industry"
"Technical support, by phone or by email","Technical support, by phone or by email"
"Prerequisites","Prerequisites"
-"You should have a SendinBlue account. You can create a free account here : ","You should have a SendinBlue account. You can create a free account here : "
+"You should have a Sendinblue account. You can create a free account here : ","You should have a Sendinblue account. You can create a free account here : "
"Settings","Settings"
-"Activate the SendinBlue module","Activate the SendinBlue module"
+"Activate the Sendinblue module","Activate the Sendinblue module"
"API key v2","API key v2"
-"Please enter your API key from your SendinBlue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey","Please enter your API key from your SendinBlue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey"
-"Activate SendinBlue to manage subscribers","Activate SendinBlue to manage subscribers"
-"Activate SendinBlue to manage subscribers","Activate SendinBlue to manage subscribers"
+"Please enter your API key from your Sendinblue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey","Please enter your API key from your Sendinblue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey"
+"Activate Sendinblue to manage subscribers","Activate Sendinblue to manage subscribers"
+"Activate Sendinblue to manage subscribers","Activate Sendinblue to manage subscribers"
"Your lists","Your lists"
"Update","Update"
-"Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your SendinBlue account and we have selected it","Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your SendinBlue account and we have selected it"
+"Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your Sendinblue account and we have selected it","Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your Sendinblue account and we have selected it"
"With this option, contacts are directly added to your list when they enter their email address. No confirmation email is sent.","With this option, contacts are directly added to your list when they enter their email address. No confirmation email is sent."
"This confirmation email is one of your SMTP templates. By default, we have created a Default Template - Single Confirmation.","This confirmation email is one of your SMTP templates. By default, we have created a Default Template - Single Confirmation."
"By selecting this option, contacts are directly added to your list when they enter their email address on the form. A confirmation email will automatically be sent following their subscription.","By selecting this option, contacts are directly added to your list when they enter their email address on the form. A confirmation email will automatically be sent following their subscription."
"Select Template","Select Template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter"
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter"
"If you select the Double Opt-in confirmation, subscribers will receive an email inviting them to confirm their subscription. Before confirmation, the contact will be saved in the 'FORM' folder, on the 'Temp - DOUBLE OPT-IN' list. After confirmation, the contact will be saved in the 'Corresponding List' selected above.","If you select the Double Opt-in confirmation, subscribers will receive an email inviting them to confirm their subscription. Before confirmation, the contact will be saved in the 'FORM' folder, on the 'Temp - DOUBLE OPT-IN' list. After confirmation, the contact will be saved in the 'Corresponding List' selected above."
"Once the form has been completed, your contact will receive an email with a link to confirm their subscription.","Once the form has been completed, your contact will receive an email with a link to confirm their subscription."
"Default Template","Default Template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter"
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter"
"Redirect URL after clicking in the validation email","Redirect URL after clicking in the validation email"
"Redirect your contacts to a landing page or to your website once they have clicked on the confirmation link in the email.","Redirect your contacts to a landing page or to your website once they have clicked on the confirmation link in the email."
"Once a contact has clicked in the double opt-in confirmation email, send them a final confirmation email","Once a contact has clicked in the double opt-in confirmation email, send them a final confirmation email"
"Select Template","Select Template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter"
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter"
"Import Old Subscribers","Import Old Subscribers"
-"To synchronize the emails of your customers from SendinBlue platform to your e-commerce website, you should run ","To synchronize the emails of your customers from SendinBlue platform to your e-commerce website, you should run "
+"To synchronize the emails of your customers from Sendinblue platform to your e-commerce website, you should run ","To synchronize the emails of your customers from Sendinblue platform to your e-commerce website, you should run "
"this link","this link"
"each day","each day"
"Code tracking","Code tracking"
"Do you want to install a tracking code when validating an order","Do you want to install a tracking code when validating an order"
-"This feature will allow you to transfer all your customers orders from Magento into SendinBlue to implement your email marketing strategy.","This feature will allow you to transfer all your customers orders from Magento into SendinBlue to implement your email marketing strategy."
+"This feature will allow you to transfer all your customers orders from Magento into Sendinblue to implement your email marketing strategy.","This feature will allow you to transfer all your customers orders from Magento into Sendinblue to implement your email marketing strategy."
"Import the data of previous orders","Import the data of previous orders"
-"Activate SendinBlue SMTP for your transactional emails","Activate SendinBlue SMTP for your transactional emails"
+"Activate Sendinblue SMTP for your transactional emails","Activate Sendinblue SMTP for your transactional emails"
"Transactional email is an expected email because it is triggered automatically after a transaction or a specific event. Common examples of transactional email are : account opening and welcome message, order shipment confirmation, shipment tracking and purchase order status, registration via a contact form, account termination, payment confirmation, invoice etc.","Transactional email is an expected email because it is triggered automatically after a transaction or a specific event. Common examples of transactional email are : account opening and welcome message, order shipment confirmation, shipment tracking and purchase order status, registration via a contact form, account termination, payment confirmation, invoice etc."
"Send email test From / To :","Send email test From / To :"
"Manage SMS","Manage SMS"
@@ -94,7 +94,7 @@
" contacts subscribed and "," contacts subscribed and "
" contacts unsubscribed from Magento."," contacts unsubscribed from Magento."
" For less details,"," For less details,"
-"Click on the icon to subscribe / unsubscribe the sms from SendinBlue and Magento.","Click on the icon to subscribe / unsubscribe the sms from SendinBlue and Magento."
+"Click on the icon to subscribe / unsubscribe the sms from Sendinblue and Magento.","Click on the icon to subscribe / unsubscribe the sms from Sendinblue and Magento."
"Unsubscribe the contact","Unsubscribe the contact"
"Subscribe the contact","Subscribe the contact"
"Unsubscribe the sms","Unsubscribe the sms"
@@ -106,7 +106,7 @@
"No confirmation","No confirmation"
"Simple confirmation","Simple confirmation"
"Double opt-in confirmation","Double opt-in confirmation"
-"About SendinBlue","About SendinBlue"
+"About Sendinblue","About Sendinblue"
"Subscribe Manager","Subscribe Manager"
"Transactional Emails and SMS Management","Transactional Emails and SMS Management"
"Contact List","Contact List"
diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv
index e1b7acf..1e3ea89 100644
--- a/i18n/fr_FR.csv
+++ b/i18n/fr_FR.csv
@@ -1,56 +1,55 @@
-"SendinBlue : THE all-in-one plugin for your marketing and transactional emails.","SendinBlue : LE plugin tout-en-un pour vos emails marketing et transactionnels."
-"About SendinBlue","About SendinBlue"
-"For further informations, please visit our website","Pour plus d'informations, merci de visiter notre site internet:"
-"With the SendinBlue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.","Avec le module SendinBlue, retrouvez tout ce dont vous avez besoin pour envoyer simplement et efficacement vos campagnes emailing & SMS à vos prospects et clients :"
-"Synchronize your subscribers with SendinBlue (subscribed contacts)","Synchronisation automatique de vos contacts avec SendinBlue (inscrits)"
+"Sendinblue : THE all-in-one plugin for your marketing and transactional emails.","Sendinblue : LE plugin tout-en-un pour vos emails marketing et transactionnels."
+"About Sendinblue","A propos de Sendinblue"
+"For further informations, please visit our website","Pour plus d'informations, visitez notre site internet:"
+"With the Sendinblue plugin, you can find everything you need to easily and efficiently send your email & SMS campaigns to your prospects and customers.","Avec le module Sendinblue, retrouvez tout ce dont vous avez besoin pour envoyer simplement et efficacement vos campagnes emailing & SMS à vos prospects et clients :"
+"Synchronize your subscribers with Sendinblue (subscribed contacts)","Synchronisation automatique de vos contacts avec Sendinblue (inscrits)"
"Easily create good looking emailings","Outils d'aide à la création d'emailings"
-"Schedule your campaigns","Schedule your campaigns"
-"Track your results and optimize","Suivi des résultats"
-"Monitor your transactional emails (purchase confirmation, password reset, etc) with a better deliverability and real-time analytics","Pilotage simple et efficace de vos emails transactionnels (emails de confirmation de commande, de récupération de mot de passe …) avec une meilleure délivrabilité et le détail des ouvertures et des clics en temps réel"
-"Why should you use SendinBlue ?","Pourquoi utiliser SendinBlue ?"
+"Schedule your campaigns","Création et envoi de campagnes"
+"Track your results and optimize","Suivi et optimisation de vos résultats"
+"Monitor your transactional emails (purchase confirmation, password reset, etc) with a better deliverability and real-time analytics","Gestion simple et efficace de vos emails transactionnels (emails de confirmation de commande, de récupération de mot de passe …) avec une meilleure délivrabilité et le détail des ouvertures et des clics en temps réel"
+"Why should you use Sendinblue ?","Pourquoi utiliser Sendinblue ?"
"Optimized deliverability","Une délivrabilité optimisée"
"Unbeatable pricing – best value in the industry","Les meilleurs prix du marché, sans engagement"
"Technical support, by phone or by email","Un support technique joignable par téléphone ou par email"
-"Prerequisites","Prerequisites"
-"You should have a SendinBlue account. You can create a free account here : ","You should have a SendinBlue account. You can create a free account here : "
+"Prerequisites","Prérequis"
+"You should have a Sendinblue account. You can create a free account here : ","Un compte Sendinblue est nécessaire, créez un compte gratuit ici : "
"Settings","Paramètres"
-"Activate the SendinBlue module","Activer le module SendinBlue:"
-"API key v2","Clé API v2:"
-"Please enter your API key from your SendinBlue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey","Veuillez renseigner votre clé API qui est liée à votre compte SendinBlue. Elle est disponible sur cette page: https://my.sendinblue.com/integration. Si vous ne possédez pas de compte SendinBlue, vous devez créer un compte sur le site https://www.sendinblue.com"
-"Activate SendinBlue to manage subscribers","Activer SendinBlue pour gérer vos contacts"
+"Activate the Sendinblue module","Activer le module Sendinblue:"
+"API key v2","Clé API v2"
+"Please enter your API key from your Sendinblue account and if you don't have it yet, please go to www.sendinblue.com and subscribe. You can then get the API key from https://my.sendinblue.com/advanced/apikey","Veuillez renseigner votre clé API qui est liée à votre compte Sendinblue. Elle est disponible sur cette page : https://my.sendinblue.com/integration. Si vous ne possédez pas de compte Sendinblue, vous devez créer un compte sur le site https://www.sendinblue.com"
+"Activate Sendinblue to manage subscribers","Activer Sendinblue pour gérer vos contacts"
"Your lists","Vos listes"
"Update","Mettre à jour"
-"Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your SendinBlue account and we have selected it","Choisissez les listes de contacts où vous souhaitez enregistrer les contacts de votre site Magento. Nous avons créé automatiquement une liste Magento sur votre compte SendinBlue, elle est sélectionnée par défaut."
+"Select the contact list where you want to save the contacts of your site Magento. By default, we have created a list Magento in your Sendinblue account and we have selected it","Choisissez les listes de contacts où vous souhaitez enregistrer les contacts de votre site Magento. Nous avons créé automatiquement une liste Magento sur votre compte Sendinblue, elle est sélectionnée par défaut."
"With this option, contacts are directly added to your list when they enter their email address. No confirmation email is sent.","Avec cette option, votre contact s'inscrit directement à votre liste en laissant son adresse email. Aucun email de confirmation lui est envoyé."
"This confirmation email is one of your SMTP templates. By default, we have created a Default Template - Single Confirmation.","Cet email de confirmation fait partie de vos templates SMTP. Par défaut, nous en avons créé un 'Default Template - Simple Confirmation'."
"By selecting this option, contacts are directly added to your list when they enter their email address on the form. A confirmation email will automatically be sent following their subscription.","En choisissant cette option, votre contact s'inscrira directement à la liste en laissant son adresse email dans le formulaire. Un email de confirmation de son inscription lui sera automatiquement envoyé à la suite de son inscription."
"Select Template","Sélectionnez un template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template SendinBlue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template Sendinblue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
"If you select the Double Opt-in confirmation, subscribers will receive an email inviting them to confirm their subscription. Before confirmation, the contact will be saved in the 'FORM' folder, on the 'Temp - DOUBLE OPT-IN' list. After confirmation, the contact will be saved in the 'Corresponding List' selected above.","Si vous choisissez la confirmation Double Opt-in, l'abonné recevra un email l'invitant à confirmer son inscription. Avant la confirmation, le contact est sauvegardé dans le dossier 'FORM', liste 'Temp - DOUBLE OPTIN', après confirmation, le contact est sauvegardé dans la 'Liste correspondante' choisie ci-dessous."
"Once the form has been completed, your contact will receive an email with a link to confirm their subscription.","Lorsque le formulaire est rempli, votre contact recevra un email avec un lien de confirmation d'inscription."
-"Default Template","Default Template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template SendinBlue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
+"Default Template","Template par défaut"
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template Sendinblue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
"Redirect URL after clicking in the validation email","URL de redirection après clic dans l'email de validation"
"Redirect your contacts to a landing page or to your website once they have clicked on the confirmation link in the email.","Redirigez votre contact vers une landing page ou votre site après qu'il ait validé le lien de confirmation dans l'email."
"Once a contact has clicked in the double opt-in confirmation email, send them a final confirmation email","Lorsqu'un contact a cliqué dans le lien de l'email de confirmation double opt-in, lui envoyer un email final de confirmation"
"Select Template","Sélectionnez un template"
-"Select a SendinBlue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template SendinBlue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
-"Import Old Subscribers","Importer les anciens abonnés"
-"To synchronize the emails of your customers from SendinBlue platform to your e-commerce website, you should run ","Pour synchroniser les emails de vos clients de la plateforme SendinBlue vers votre site e-commerce website, il faudra exécuter "
+"Select a Sendinblue template that will be sent personalized for each contact that subscribes to your newsletter","Sélectionnez un template Sendinblue qui sera envoyé pour chaque contact qui s'abonne à votre newsletter"
+"Import Old Subscribers","Importer les abonnés existants"
+"To synchronize the emails of your customers from Sendinblue platform to your e-commerce website, you should run ","Pour synchroniser les emails de vos clients de la plateforme Sendinblue vers votre site e-commerce website, il faudra exécuter "
"this link","ce lien"
"each day","chaque jour."
-"Code tracking","Code de tracking"
-"Do you want to install a tracking code when validating an order","Voulez vous installer un code de tracking lors de la validation d'une commande"
-"This feature will allow you to transfer all your customers orders from Magento into SendinBlue to implement your email marketing strategy.","Cette fonctionnalité vous permettra de remonter vos commandes réalisées depuis votre site Magento vers SendinBlue afin de mettre en place des strategies marketing lors de l'envoi de vos campagnes."
-"Import the data of previous orders","Import the data of previous orders"
-"Activate SendinBlue SMTP for your transactional emails","Activer SendinBlue SMTP pour vos emails transactionnels"
-"Transactional email is an expected email because it is triggered automatically after a transaction or a specific event. Common examples of transactional email are : account opening and welcome message, order shipment confirmation, shipment tracking and purchase order status, registration via a contact form, account termination, payment confirmation, invoice etc.","SendinBlue SMTP permet d'envoyer des emails transactionnels (un email transactionnel est envoyé pour attester d'une transaction ou d'un évènement. Exemple : email d'inscription, de confirmation de commande, une facture …). En activant cette fonctionnalité, vous êtes sûr que vos emails transactionnels parviennent bien à vos destinataires et vous pouvez consulter l'historique de vos emails (ouvertures, clics …)."
+"Do you want to install a tracking code when validating an order","Voulez-vous installer un code de tracking lors de la validation d'une commande"
+"This feature will allow you to transfer all your customers orders from Magento into Sendinblue to implement your email marketing strategy.","Cette fonctionnalité vous permettra de remonter vos commandes réalisées depuis votre site Magento vers Sendinblue afin de mettre en place des strategies marketing lors de l'envoi de vos campagnes."
+"Import the data of previous orders","Importer les commandes existantes"
+"Activate Sendinblue SMTP for your transactional emails","Activer Sendinblue SMTP pour vos emails transactionnels"
+"Transactional email is an expected email because it is triggered automatically after a transaction or a specific event. Common examples of transactional email are : account opening and welcome message, order shipment confirmation, shipment tracking and purchase order status, registration via a contact form, account termination, payment confirmation, invoice etc.","Sendinblue SMTP permet d'envoyer des emails transactionnels (un email transactionnel est envoyé pour attester d'une transaction ou d'un évènement. Exemple : email d'inscription, de confirmation de commande, une facture …). En activant cette fonctionnalité, vous êtes sûr que vos emails transactionnels parviennent bien à vos destinataires et vous pouvez consulter l'historique de vos emails (ouvertures, clics …)."
"Send email test From / To :","Envoyer un email de test à"
"Manage SMS","Gestion des SMS"
"Currently you have","Actuellement, vous avez"
"credits sms. To buy more credits, please click","crédits SMS. Pour acheter plus de crédits, cliquez "
"here","ici"
-"You want to be notified by e-mail when you do not have enough credits?","Voulez vous être prévenu par e-mail lorsqu'il vous reste peu de crédits ?"
+"You want to be notified by e-mail when you do not have enough credits?","Voulez-vous être prévenu par e-mail lorsqu'il vous reste peu de crédits ?"
"Yes","Oui"
"Please provide valid Email!","Veuillez renseigner un email valide"
"Please provide a limit in integer format","Le champ limite doit être un nombre entier"
@@ -60,13 +59,13 @@
"Send SMS after order confirmation","Envoyer un SMS après la confirmation de commande"
"SMS settings:","Paramètres du SMS"
"This field allows you to customize the SMS sender. The number of characters is limited to 11 alphanumeric characters. You can´t configure your Sender with a phone number.","Ce champs permet de personnaliser l'expéditeur du SMS. Il ne doit pas contenir plus de 11 caractères. Les caractères spéciaux (é, à ...) ne sont pas acceptés."
-"Number of characters left:","Nombre de caractères restants: "
+"Number of characters left:","Nombre de caractères restants : "
"Message","Message"
"Create the content of your SMS with the limit of 160-character.Beyond 160 characters, it will be counted as a second SMS. Thus, if you write SMS of 240 characters, it will be recorded using two SMS.","Créer le contenu de vos SMS avec une limite de 160 caractères. Au-delà de 160 caractères, il sera compté comme un second SMS. Ainsi, si vous écrivez un SMS de 240 caractères, il sera compté comme deux SMS."
-"Number of SMS used:","Nombre de SMS utilisé(s):"
-"Number of characters left:","Nombre de SMS utilisé(s):"
+"Number of SMS used:","Nombre de SMS utilisé(s) :"
+"Number of characters left:","Nombre de SMS utilisé(s) :"
"Attention line break is counted as a single character.","Attention, un saut de ligne est compté comme un seul caractère. "
-"If you want to personalize the SMS, you can use the variables below:","Si vous souhaitez personnaliser les SMS, vous pouvez utiliser les variables ci-dessous:"
+"If you want to personalize the SMS, you can use the variables below:","Si vous souhaitez personnaliser les SMS, vous pouvez utiliser les variables ci-dessous :"
"- For first name use {first_name}","- Pour afficher le prénom, utiliser {first_name}"
"- For last name use {last_name}","- Pour afficher le nom, utiliser {last_name}"
"- For order reference id use {order_reference}","- Pour afficher l'id de la commande, utiliser {order_reference}"
@@ -76,7 +75,7 @@
"Please fill the message field","Veuillez remplir le champ message"
"Send a test SM","Envoyer un SMS de test"
"The phone number should be in this form: 0033663309741 for this France mobile 06 63 30 97 41 (0033 is France prefix)","Le numéro de téléphone mobile devrait être sous cette forme: 0033663309741 pour le numéro français 06 63 30 97 41 (0033 est l'indicatif de la France)"
-"Sending a test SMS will be deducted from your SMS credits.","L'envoi d'un SMS test sera décompté de vos crédits SMS. "
+"Sending a test SMS will be deducted from your SMS credits.","L'envoi d'un SMS de test sera décompté de vos crédits SMS. "
"Send a SMS confirmation for the shipment of the order","Envoyer un SMS après l'expédition de commande"
"Sender","Expéditeur"
"Attention line break is counted as a single character.","Attention, un saut de ligne est compté comme un seul caractère. "
@@ -86,26 +85,37 @@
"A single contact","Un seul contact"
"All my Magento customers","Tous mes contacts Magento"
"Phone number of the contact","Numéro de téléphone du contact"
-"Schedule your sms campaign","Schedule your sms campaign"
+"Schedule your sms campaign","Programmez votre campagne SMS"
"Message","Message"
"You have ","Vous avez "
" contacts subscribed and "," contacts inscrits et "
" contacts unsubscribed from Magento."," contacts désinscrits de Magento."
" For less details,"," Pour moins de détails, cliquez"
-"Click on the icon to subscribe / unsubscribe the sms from SendinBlue and Magento.","Cliquez sur l'icône pour inscrire / désinscrire un sms de SendinBlue et Magento."
-"Unsubscribe the contact","Unsubscribe the contact"
-"Subscribe the contact","Subscribe the contact"
-"Unsubscribe the sms","Unsubscribe the sms"
-"Subscribe the sms","Subscribe the sms"
-"First","First"
-"Last","Last"
-"Previous","Previous"
-"Next","Next"
+"Click on the icon to subscribe / unsubscribe the sms from Sendinblue and Magento.","Cliquez sur l'icône pour inscrire / désinscrire un SMS de Sendinblue et Magento."
+"Unsubscribe the contact","Désinscrire le contact"
+"Subscribe the contact","Inscrire le contact"
+"Unsubscribe the sms","Désinscrire le SMS"
+"Subscribe the sms","Inscrire le SMS"
+"First","Premier"
+"Last","Dernier"
+"Previous","Précédent"
+"Next","Suivant"
"No confirmation","Aucune confirmation"
"Simple confirmation","Confirmation simple"
"Double opt-in confirmation","Double opt-in confirmation"
-"About SendinBlue","About SendinBlue"
-"Subscribe Manager","Subscribe Manager"
+"About Sendinblue","A propos de Sendinblue"
+"Subscribe Manager","Gestion des abonnés"
"Transactional Emails and SMS Management","Gestion des Emails Transactionnels et des SMS"
-"Contact List","listes de contacts"
-
+"Contact List","Listes de contacts"
+"Contact Sendinblue Team","Contactez l’équipe Sendinblue"
+"For further informations, please visit our website:","Pour plus d’informations, visitez notre site web :"
+"Save","Sauvegarder"
+"Limit","Limite"
+"Send","Envoyer"
+"For more details,","Pour plus de détails,"
+"click here","Cliquez ici"
+"Send a final confirmation email","Envoyer un dernier email de confirmation"
+"Send the campaign","Envoyer la campagne"
+"Contact us:","Contactez-nous :"
+"No","Non"
+"Code tracking","Code de tracking"
diff --git a/view/adminhtml/templates/sib.phtml b/view/adminhtml/templates/sib.phtml
old mode 100755
new mode 100644
index f9ab621..6c5b6e1
--- a/view/adminhtml/templates/sib.phtml
+++ b/view/adminhtml/templates/sib.phtml
@@ -8,6 +8,9 @@ $apiKeyStatus = !empty($model->getDbData('api_key_status'))
? $model->getDbData('api_key_status') : '';
$formKey = $block->getFormValue();
+$newIconSvg = '';
?>
@@ -35,7 +38,7 @@ $formKey = $block->getFormValue();