I am trying to send email through sendgrid in a Zend application. I am copying php code from sendgrid documentation (smtapi and swift class).
I am creating a template with places that should be replaced with% variable%. Now I am creating headers for sendgrid as defined here: http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/
As a result, I get something similar to this:
{
"to": ["mail1@domain.com", "mail2@domain.com", "mail3@domain.com", "mail4@domain.com", "sfwwnkff@sharklasers.com"],
"sub": {"%firstname%": ["Benny", "Chaim", "Ephraim", "Yehuda", "will"]},
"section": {"%postername%": "John Doe", "%postermail%": "james@doe.com", "%categoryname%": "General", "%threadname%": "Completely new thread", "%post%": "This thread is to inform you about something very important", "%threadurl%": "http:\/\/hb.local\/forums\/general\/thread\/143", "%replyto%": "http:\/\/hb.local\/forums\/general\/thread\/143", "%unsubscribeurl%": "http:\/\/hb.local\/forums\/settings\/", "%subscribeurl%": "http:\/\/hb.local\/forums\/subscribe-thread\/id\/143\/token\/1b20eb7799829e22ba2d48ca0867d3ce"}
}
Now that all the data defined in the "sub" changes, I can not make the partition work. In the last letter I received% postername%. When I move this data to sub and repeat it for each letter, everything works fine.
Does anyone know what I'm doing wrong?
The documents for the section are here: http://docs.sendgrid.com/documentation/api/smtp-api/developers-guide/section-tags/
source
share