Description
A transaction mail is a single mail to be sent by Backclick. It is neither related to a campaign, nor to a mailing list.
Prior to sending the E-Mail it is examined whether the mandator given is authorized to send E-Mails for the domain of the senders address. If this is not the case, a corresponding error message will be created.
There are specific evaluation components for transaction mails in Backclickâs report manager in order to track and evaluate dispatches and reactions to transaction mails.
It is possible to personalize transaction mails (using the regular personalization variant used in Backclick) and there is an online version of the mails available.
You can add attachments to transaction mails as well. These have to be provided as Base64 encoded data.
Needless to say, while sending this E-Mail all technical advantages of Backclick are available, this means the E-Mail is generated RFC-conform and, if the senders domain configured DKIM, this E-Mail is signed accordingly.
Available starting from Backclick-Version: 5.8.4
In order to send a transaction mail you have to provide the following information:
- Mandator ID
- API-Key (optional authentication, if not provided the IP address will be used for authentication)
- Channel-ID (the channel can either be added via the Backclick interface or via SOAP (Transactions-Create Channel))
- Campaign ID
- Subject of the E-Mail
- Senders address
- Senders name
- Content of the E-Mail (you can either use text or HTML. Backclick uses the right encoding format automatically. Alternatively you can use a template ID)
- Recipient of the E-Mail:
- Recipients E-Mail address
- Personal information about the recipient
- List the recipient is supposed to be added to in Backclick additionally
- Reply-To address
- List of attachments
- Name of the attachment
- Data of the attachment
- ID of the coupon list (if you want to add a coupon to the mailing, you can provide the coupon list ID from Backclick here)
Optionally you can provide the alternative text to your E-Mail as well. If an alternative text is provided the content has to be âHTMLâ and the alternative text âTextâ.
The following error messages can occur in a faulty request:
- Invalid domain of sender address (âexample.comâ). If you want to send email from this domain, please contact your admin. => The sender domain given cannot be used with this mandator.
- No templateId AND no newsletter content given!
- Template with ID n does not exist!
- Both (mailContent AND alternativeMailContent is HTML).
- Both (mailContent AND alternativeMailContent is TEXT).
- Both templateId AND newsletterContent given, donât know what to send.
- Channel with ID yourID does not exist.
- Address was unsubscribed, anti spam option is enabled. => In case you wanted to add the recipient to a list, his last action was an unsubscription. The subscriber is not saved.
- Address is at robinson list. =>Â In case you wanted to add the recipient to a list, he is present on the Robinson list.
- Error creating subscriber
- Sending denied: Recipient address is on one of the black lists.
- Error compiling newsletter template yourID => An error occured while creating the content from a template
- Field âfieldnameâ does not exist in Backclick.
- Error creating transaction mail. If this error remains, please contact Backclick support.
- Got attachment with no name.
- Invalid attachment data for file name âName of the attachmentâ
Example
$client = new SoapClient($wsdlUrl);
date_default_timezone_set('Europe/Berlin');
$transactionMail = new StdClass();
$transactionMail->mandatorId = 0;
$transactionMail->channelId = 1;
$transactionMail->senderName = 'Name des Absenders';
$transactionMail->senderEmail = '[email protected]';
$transactionMail->recipient = new StdClass();
$transactionMail->recipient->emailAddress = '[email protected]';
$transactionMail->recipient->recipientFields = array();
$recipientField = new StdClass();
$recipientField->fieldName = 'VORNAME';
$recipientField->fieldValue = utf8_encode('Max');
array_push($transactionMail->recipient->recipientFields, $recipientField);
$recipientField = new StdClass();
$recipientField->fieldName = 'NACHNAME';
$recipientField->fieldValue = utf8_encode('Mustermann');
array_push($transactionMail->recipient->recipientFields, $recipientField);
$transactionMail->subject = utf8_encode('Transaktionsmail an $$VORNAME$$ $$NACHNAME$$');
$transactionMail->mailContent = utf8_encode('<html><body>Hallo $$VORNAME$$ $$NACHNAME$$</body></html>');
try {
$result = $client->sendTransactionMail($transactionMail);
var_dump($result);
} catch (Exception $e) {
echo "Fehler aufgetreten: " . $e->getMessage() . "\n";
}
object(stdClass)#2 (1) {
["success"]=>
bool(true)
}
Source code
In order to test a working example you can download the source code.
Example for sending a transaction mail
Â