Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Victor Bjørholm 51 posts 173 karma points
    Jan 09, 2021 @ 14:20
    Victor Bjørholm

    _emailTemplateService.GetEmailTemplate returns NULL

    Hi Matt or whomever might be able to answer, I've recently (not sure when) started issues with my mail service. For some reason it is not working anymore.

    I've put in breakpoints and I am pretty sure I've located the error. When defining the emailTemplate, it returns Null. I am almost positive this error started when I updated Vendr, but I haven't been able to finde any changes in the docs?

    Any help would be appreciated

    Guid template = new Guid("44ab28bc-08df-4fa2-81f3-d2ad536db0ef");
    //The Guid template is a Guid to a predefined email template, the 
    var emailTemplate = _emailTemplateService.GetEmailTemplate(template);

    *EDIT I have tried to check for templates as well and everything seems to be working

    var emailTemplates = _emailTemplateService.GetEmailTemplates(store);
    bool exists = _emailTemplateService.EmailTemplateExists(store, "shippingEmail");

    emailTemplates returns 4 which is correct, and exists returns true so I can find the email Template. For some reason it just wont get the template

  • Victor Bjørholm 51 posts 173 karma points
    Jan 09, 2021 @ 18:42
    Victor Bjørholm

    Got it fixed. Worked when I changed

    var emailTemplate = _emailTemplateService.GetEmailTemplate(template);


    EmailTemplateReadOnly emailTemplate = _emailTemplateService.GetEmailTemplate(template);
Please Sign in or register to post replies

Write your reply to: