Updating task that sends emails to use my own service
Hi,
I'm currently in dev with tea commerce and I'm running into a few issues...
Firstly on success, success emails aren't sending giving me this error
Error sending Confirmation email template. Order id: c234ac35-cb2e449b-bb94-dc501b53f68f. Cart number: CART-29 System.Net.Mail.SmtpException: The operation has timed out.
at System.Net.Mail.SmtpClient.Send(MailMessage message)
at TeaCommerce.Api.Models.EmailTemplate.Send[T](T model, String customerEmail, Nullable`1 languageId)
I believe this is down to the credentials that I have input being incorrect, but at my company, we have our own email sending service which I need to implement into tea commerce.
Is there any way I can update the send email task so I can use my own service instead of the default one?
You can canel the email sent by Tea Commerce, and use your own email sending service instead, by subscribing to the MailSending event.
You can subscribe to events using the Notification Center: Tea Commerce docs
Something like this would probably do the trick:
using TeaCommerce.Api.Models;
using TeaCommerce.Api.Notifications;
using Umbraco.Core;
namespace Website.Events {
public class TeaCommerceEventHandler : ApplicationEventHandler {
public TeaCommerceEventHandler() {
NotificationCenter.EmailTemplate.MailSending += EmailTemplate_MailSending;
}
private void EmailTemplate_MailSending( EmailTemplate emailTemplate, MailSendingEventArgs e ) {
if ( emailTemplate.Alias == "confirmation" ) {
e.Cancel = true; //Cancel the mail sent by Tea Commerce
MyOwnEmailSendingService.Instance.SendConfirmation( e.Order );
}
}
}
}
Updating task that sends emails to use my own service
Hi,
I'm currently in dev with tea commerce and I'm running into a few issues...
Firstly on success, success emails aren't sending giving me this error
I believe this is down to the credentials that I have input being incorrect, but at my company, we have our own email sending service which I need to implement into tea commerce.
Is there any way I can update the send email task so I can use my own service instead of the default one?
Thanks, Lewis
Hi Lewis,
You can canel the email sent by Tea Commerce, and use your own email sending service instead, by subscribing to the MailSending event.
You can subscribe to events using the Notification Center: Tea Commerce docs
Something like this would probably do the trick:
is working on a reply...