Sending custom Email using TeaCommerce Email templates
Hi guys,
Would you be able to point me in the right direction to get this to work e.g. some documentation around how the email templates are set up and work, so basically am trying to use 1 of the built in email templates to manually send a customized email (HTML Wise) after an order is complete.
Initially just trying to send the email from an order using the confirmation email out of the box, i am getting the error below:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25
So am thinking there is some configuration of some sort that i need to enable sending these email.
In my system am currently using Custom logic to send emails using SendGrid, how can i, if possible, use sendgrid to also send the email, assuming i can pretty much use the template i.e. email-template-confirmation.cshtml to customize the HTML i want to be sent in the email.
Thanks for the details will give that a go and let you know how i get on, def didnt have any SMTP setting in my web config as i am using this sendgrid Nuget package https://github.com/sendgrid/sendgrid-csharp which only need the API Key.
As for sending the email template itself, guess if its from the order page shown below i don't need to use the EmailTemplateService , that will only be if im sending it manually from my own code right?
Sending custom Email using TeaCommerce Email templates
Hi guys,
Would you be able to point me in the right direction to get this to work e.g. some documentation around how the email templates are set up and work, so basically am trying to use 1 of the built in email templates to manually send a customized email (HTML Wise) after an order is complete.
Initially just trying to send the email from an order using the confirmation email out of the box, i am getting the error below:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25
So am thinking there is some configuration of some sort that i need to enable sending these email.
In my system am currently using Custom logic to send emails using SendGrid, how can i, if possible, use sendgrid to also send the email, assuming i can pretty much use the template i.e. email-template-confirmation.cshtml to customize the HTML i want to be sent in the email.
Thanks for the help.
Hi Denford,
That exception suggests it is attempting to send the email, but the server doesn't have an SMTP service configured.
You'll need to make sure you have SMTP configuration in your web.config, setup with some working details.
If you want to use SendGrid you should checkout their docs to see how to use them as a SMTP gateway https://docs.sendgrid.com/for-developers/sending-email/integrating-with-the-smtp-api
In terms of how you send an email, you'll need to use the EmailTemplateService
This should automatically create the email and send it using the configured SMTP credentials mentioned above.
Thanks for the details will give that a go and let you know how i get on, def didnt have any SMTP setting in my web config as i am using this sendgrid Nuget package https://github.com/sendgrid/sendgrid-csharp which only need the API Key.
As for sending the email template itself, guess if its from the order page shown below i don't need to use the EmailTemplateService , that will only be if im sending it manually from my own code right?
Hi Denford,
Glad that worked for you. And yea, if you are just using the "send email" button, then you don't need to do any custom code. 👍
Matt
is working on a reply...