The Inx_Api_Util_TemporaryMailSender may be used to send Inx_Api_Util_TemporaryMails.
The Inx_Api_Util_TemporaryMailSender may be used to send Inx_Api_Util_TemporaryMails. A TemporaryMail is a mailing that may be sent to a single recipient that does not have to be a registered recipient in Inxmail. The mailing will not be personalized and will not be saved in Inxmail and therefore won't be trackable. The following snippet shows how to send a temporary mail:
$oListContextManager = $oSession->getListContextManager(); $oListContext = $oListContextManager->findByName( Inx_Api_List_SystemListContext::NAME ); $oTemporaryMailSender = $oSession->getTemporaryMailSender(); $oTemporaryMail = $oTemporaryMailSender->createTemporaryMail( $oListContext ); $oTemporaryMail->updateRecipientAddress( "recipient@domain.invalid" ); $oTemporaryMail->updateSenderAddress( "sender@domains.invalid" ); $oTemporaryMail->updateSubject( "Temporary Mailing" ); $oTemporaryMail->setContentHandler( 'Inx_Api_Mailing_HtmlTextContentHandler' ); $oHtmlTextContentHandler = $oTemporaryMail->getContentHandler(); $oHtmlTextContentHandler->updateContent( "<html><head></head><body>Hi there,<br>this is a temporary mailing!</body></html>" ); $blSuccess = $oTemporaryMailSender->sendTemporaryMail( $oTemporaryMail ); if( $blSuccess ) { echo "Mailing sended.<br>"; } else { echo "Mailing not sended.<br>"; }The approach shown above will send a mail to the specified recipient address without any personalization. To personalize a mailing for a specific recipient, use the sendTemporaryMail($oTemporaryMail, $iRecipientId) method instead. You can mix using this method and explicitly specifying a recipient address to send a mailing to a recipient (possibly unknown to Inxmail) which was personalized for a different recipient.
<strong>Note:</strong> Be aware that the bool returned by the send method does not state if the mail has really been sent. The method may return true even though no recipient address was specified, thus the mail was not sent to any recipient. The only requirement is that the sender address has been set and the content is not null or empty. The sender address may also be determined by the list provided on the creation of the mail, as long as the address is configured.
For more information on temporary mails in general, see the Inx_Api_Util_TemporaryMail documentation.
Located in /Api/Util/TemporaryMailSender.php (line 59)
Creates a TemporaryMail using the sender address of the specified list by default.
Creates a TemporaryMail using the sender address of the specified list by default.
Sends the specified TemporaryMail to the given recipient, if any was passed.
Sends the specified TemporaryMail to the given recipient, if any was passed. The mail will be personalized for this recipient. It is possible to override the recipient address using Inx_Api_Util_TemporaryMail::updateRecipientAddress($sRecipientAddress). Using this approach you can send a mail to a recipient which is personalized for a different recipient. <strong>Note:</strong> If the recipient id is ommitted, you are required to specify a recipient address.
<strong>Note:</strong> This method may return true even if the recipient address was explicitly set to null.
Documentation generated on Thu, 17 Sep 2015 14:27:32 +0200 by phpDocumentor 1.3.2