Hi,
I've successfully sent an email from SendGrid with parameters passed from SF using the following core code:
SendGrid sendgrid = new SendGrid('username', 'password');
SendGrid.email email = new SendGrid.Email();
email.addTo('receiver@mail.com');
email.setFrom('sender@mail.com');
email.setSubject('Apex SendGrid Test');
SendGrid.SendGridResponse response = sendgrid.send(email);
I then created a template in SendGrid and attempted to send parameters to it from Salesforce using the following code:
SendGrid sendgrid = new SendGrid('username', 'password');
SendGrid.email email = new SendGrid.Email();
email.addFilter('templates', 'enable', '1');
email.addFilter('templates', 'template_id', '38e0b815-2551-4a9b-aa7a-e74db88329d4');
email.addTo('sender@mail.com');
email.setFrom('receiver@mail.com');
email.setSubject('Apex SendGrid Test');
SendGrid.SendGridResponse response = sendgrid.send(email);
This processes ok within Salesforce but nothing happens when it gets passed to SendGrid. Any guidance would be much appreciated.
Thanks