-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transactional email API #32
Comments
Have you had any luck @peternxyz ? It's extremely frustrating when API's are not documented in full. |
Yeah. The examples are actually generated when you set up a transactional email inside Campaign Monitor. |
The sample API call? Yeah that's true but it doesn't demonstrate how to use the .NET library. There are 100's of classes in the library. With some trial and error I could get it going, sure, but documenting it would save people lots of time. After all, we want to use and promote their service. It only makes sense to keep developers happy. |
See #40 - it’s taken me too long to work out how to send transactional email via the API. The Transactional API is quite inconsistent with the rest of the API. |
Here's a sample that sends multiple emails: public void SendEmails(string emailTemplateId, IEnumerable<UserDTO> users)
{
var transactional = Authenticate.ByClientApiKey(_apiKey);
// This is the unique identifier for this smart email
var smartEmailId = new Guid(emailTemplateId);
// build up the email
foreach (var user in users)
{
var builder = transactional.MessageBuilder();
builder.To(user.EmailAddress)
.Data(new Dictionary<string, object>
{
{ "firstName", user.FirstName },
{ "lastName", user.LastName }
});
// Send the email
builder.Send(smartEmailId);
}
} |
Hi there,
Was just wondering if you had any examples on using the Transactional API?
I had a look at the code and it seems like a lot of classes/methods were made internal. Not sure if deliberate or otherwise.
The text was updated successfully, but these errors were encountered: