Send email from email template with parameters
Can anyone share example how to send email from email template with parameters. Like example SendMailFromTemplate("MyTemplate", param1, param2 );
To send an e-mail you will need an instance of a Sender. The sender has SendMessage method that takes MailMessage as a parameter. MailMessage is created with Composer.ComposeMessage. Here you can put parameters. Here is a sample:
I tried to implement your snippet, but it seems it can't get the smtp profile to use for this. Through SMTP host was not found. How do you point to the correct SMTP profile with your code?
I used this:
Checking your code snippet, you can manipulate the SMTP profile through the NewslettersConfig which is used for getting the SMTP settings in this case.