Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Neil Hodges 338 posts 987 karma points
    Jun 26, 2013 @ 16:20
    Neil Hodges
    0

    Email member login username and password in checkout

    Hi

    Im trying to replicate this solution to this thread (this thread) to help me send an email to the user when they are created as a member within the checkout process.

    I have a class in the App_Code folder named CreateMemberAndSendPassword.cs and im having trouble with the syntax could someone possibly point out what i should be doing, i think its something simple im just missing.

     var emailService = new EmailService();
     var emailProfile = SiteContext.Current.CatalogContext.CurrentCatalogSet.EmailProfiles.Single();
      emailService.Send(emailProfile, "WelcomeEmail"new MailAddress(PurchaseOrder.Customer.EmailAddress), parameters);

    Its erroring at EmailService() it needs a parameter of IContentService? CurrentCatalogSet connat be reloved and the emailService.Send is missing a parameter.

    Any ideas what params i should be passing in for emailService.Send ? I kind of get the emailservice.send to work by doing this

    emailService.Send(emailProfile, emailProfile, "WelcomeEmail"new MailAddress(PurchaseOrder.Customer.EmailAddress), parameters);

    but im unsure thats the correct params i should be passing.

    Any ideas?

  • Neil Hodges 338 posts 987 karma points
    Jun 26, 2013 @ 16:33
    Neil Hodges
    100

    Ok i think ive sorted it, i did a bit more googling and found this :)

      var localizationContext = ObjectFactory.Instance.Resolve<ILocalizationContext>();
    
                    var emailService = ObjectFactory.Instance.Resolve<IEmailService>();
                    var emailProfile = SiteContext.Current.CatalogContext.CurrentCatalogGroup.EmailProfile;
                    emailService.Send(localizationContext, emailProfile, "WelcomeEmail"new MailAddress(PurchaseOrder.Customer.EmailAddress), parameters);

    Ive yet to test but it looks right

Please Sign in or register to post replies

Write your reply to:

Draft