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.

  • Mr A 216 posts 278 karma points
    Dec 05, 2012 @ 11:10
    Mr A
    0

    Send Email / password when members are created in checkout

    Hi ,

    I just wan to know how to send an email when the address field is filled up and member is created , what i want to do is something like when the member is created the system should send an email with the email and password so that the user can login next time to see their profile and what items they have bought from the ecommerce website.

    Is that possible to acheive using ucommerce,

    I am using the latest version of ucommerce and razor store.

    Any suggestions, alternative or assistance will be appreciated .

     

    Thanks

  • Mr A 216 posts 278 karma points
    Dec 05, 2012 @ 13:53
    Mr A
    0

    I followed your solution on one of the post:

    http://our.umbraco.org/projects/website-utilities/ucommerce/ucommerce-support/20459-Emailing-a-new-customer-their-membership-password

    but i am getting this error:

    Error Loading Razor Script (file: uCommerce Homepage Catalog) Could not convert from 'UCommerce.Pipelines.Checkout.CreateMemberAndSendPasswordTask, UCommerce.Pipelines' to System.Type - Maybe type could not be found    at Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.PerformConversion(String value, Type targetType)
      at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion(String value, Type targetType)
      at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion[TTarget](String value)
      at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)
      at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)
      at Castle.Windsor.WindsorContainer.RunInstaller()
      at UCommerce.Infrastructure.ExtendedWindsorContainer..ctor(String xmlFilePath)
      at UCommerce.Infrastructure.ObjectFactory.GetContainer()
      at UCommerce.Infrastructure.ObjectFactory.Resolve[T]()
      at UCommerce.Runtime.SiteContext.get_Current()
      at ASP._Page_macroScripts_uCommerce_HomepageCatalog_cshtml.Execute() in d:\inetpub\vhosts\tangent-design.com\subdomains\groupsavercard\httpdocs\macroScripts\uCommerce\HomepageCatalog.cshtml:line 5
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
      at System.Web.WebPages.WebPage.ExecutePageHierarchy()
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

     

  • Mr A 216 posts 278 karma points
    Dec 05, 2012 @ 13:54
    Mr A
    0

    Also the Class CreateMemberAndSendPasswordTask.cs is in App_Code

  • Søren Spelling Lund 1796 posts 2764 karma points
    Dec 07, 2012 @ 21:23
    Søren Spelling Lund
    0

    Looks like your registration of the type is missing something.

    Registering a class, which resides in the "app_code" folder is possible, but I can't seem to find the proper syntax to do it.

    This will work though: Compile the class to a DLL, add it to /bin, and register that using this syntax type="MyNamespace.MyClass, MyDLL".

  • Mr A 216 posts 278 karma points
    Dec 11, 2012 @ 14:52
    Mr A
    0

    Well I tried :

    <component id="Checkout.CreateMemberAndSendPassword"

      service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"

      type="Password.CreateMemberAndSendPasswordTask, Password"  />

    Where Password is the dll i am using and it consist of a 2 classes one of them is CreateMemberAndSendPasswordTask which contains:

     public class CreateMemberAndSendPasswordTask

        {

            public PipelineExecutionResult Execute(PurchaseOrder purchaseOrder)

            {

                

                // New an instance of our custom task

                var task = new CreateMemberAndSendPasswordInternalTask();

     

                // Save the order for use in GeneratePassword to get the e-mail

                task.PurchaseOrder = purchaseOrder;

     

                return task.Execute(purchaseOrder);

            }

        }

     

        public class CreateMemberAndSendPasswordInternalTask : CreateMemberForCustomerTask

        {

            public PurchaseOrder PurchaseOrder { get; set; }

            public override string GeneratePassword()

            {

                string password = base.GeneratePassword();

     

                var customer = PurchaseOrder.Customer;

     

                // Build a list of parameters to pass to the e-mail service

                // Parameters are passed to the configured e-mail template with the key specified, 

                // e.g. MyWelcomeTemplate.apsx?password=<generatedPassword>&firstName=<firstName>&lastName=<lastName>

                // Can also be used in the subject in the form of {password}, {firstName}, {lastName}

                var parameters = new Dictionary<string, string>();

                parameters.Add("password", password);

                parameters.Add("firstName", customer.FirstName);

                parameters.Add("lastName", customer.LastName);

                string t = customer.FirstName + customer.LastName + password;

                umbraco.library.SendMail("xxx@domain.com", PurchaseOrder.Customer.EmailAddress, "Registration", t, true);

                //var emailService = new EmailService(customer.LastName);

                //var emailProfile = SiteContext.Current.CatalogContext.CurrentCatalogSet.EmailProfiles.Single();

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

     

                return password;

            }

     

        }

     

    The error i m getting on all the pages which uses razor context is:

    Error Loading Razor Script (file: uCommerce MiniBasket) Could not set up component 'Checkout.CreateMemberAndSendPassword'. Type 'Password.CreateMemberAndSendPasswordTask, Password, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not implement service 'UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce, Version=3.0.0.12320, Culture=neutral, PublicKeyToken=null]], UCommerce, Version=3.0.0.12320, Culture=neutral, PublicKeyToken=null'    at Castle.Windsor.Installer.DefaultComponentInstaller.AssertImplementsService(String id, Type service, Type type)

      at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)

      at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)

      at Castle.Windsor.WindsorContainer.RunInstaller()

      at UCommerce.Infrastructure.ExtendedWindsorContainer..ctor(String xmlFilePath)

      at UCommerce.Infrastructure.ObjectFactory.GetContainer()

      at UCommerce.Infrastructure.ObjectFactory.Resolve[T]()

      at UCommerce.Runtime.SiteContext.get_Current()

      at ASP._Page_macroScripts_uCommerce_MiniBasket_cshtml.Execute() in d:\inetpub\vhosts\groupsavercard.com\httpdocs\macroScripts\uCommerce\MiniBasket.cshtml:line 8

      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()

      at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)

      at System.Web.WebPages.WebPage.ExecutePageHierarchy()

      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)

      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)

      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

  • Søren Spelling Lund 1796 posts 2764 karma points
    Dec 17, 2012 @ 10:16
    Søren Spelling Lund
    0

    Makes total sense.

    Your class "CreateMemberAndSendPasswordTask" needs to implment the IPIpelineTask<PurchaseOrder> for it to work.

    That's what this message is about: "Type 'Password.CreateMemberAndSendPasswordTask, Password, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not implement service 'UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce, Version=3.0.0.12320, Culture=neutral, PublicKeyToken=null]], UCommerce, Version=3.0.0.12320, Culture=neutral, PublicKeyToken=null'". It's a little cryptic so I've highlighted areas of interest in case you are wondering how to parse it.

    Here's the change you need in your code to make it work:

     

    public class CreateMemberAndSendPasswordTask : IPipelineTask<PurchaseOrder>

    Hope this helps.

     

  • Mr A 216 posts 278 karma points
    Dec 17, 2012 @ 12:41
    Mr A
    0

    Cheers Soren , that worked perfectly :)

  • Søren Spelling Lund 1796 posts 2764 karma points
    Dec 17, 2012 @ 12:53
    Søren Spelling Lund
    0

    Beautiful!

  • Tim 166 posts 347 karma points
    Jul 13, 2013 @ 15:43
    Tim
    0

    Just as a heads up to anyone else that has stumbled across this post looking for a way to create members and email them their password during the uCommerce checkout process, I've just blogged about it here: http://blogs.thesitedoctor.co.uk/tim/2013/07/13/How+To+Create+An+Umbraco+Member+And+Email+The+Customer+Their+Password+At+Checkout+Using+UCommerce.aspx

    Tim

Please Sign in or register to post replies

Write your reply to:

Draft