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.

  • Gonçalo Assunção 39 posts 68 karma points
    Jan 26, 2015 @ 19:01
    Gonçalo Assunção
    0

    Email confirmation values

    Hello guys,

     

    I am not being able to get the values from the purchase order to the order confirmation email.

    If I run the template in the browser and pass the ordernumber through a querystring, it works. But in the email body, it gives me the "Error loading MacroEngine script"...

    I know that the values are in querystring, because I made some experiences with the email, wich consisted in only getting the values from the querystring and printing them into the email body..

    Here's the code:

    @{

        var request = HttpContext.Current.Request;

     

        //var orderGuid = umbraco.library.RequestQueryString("orderNumber");

        //

    @orderGuid.ToString()

     

     

     

            var obj_basket = PurchaseOrder.SingleOrDefault(x => x.OrderNumber == umbraco.library.RequestQueryString("orderNumber"));

     

     

            umbraco.cms.businesslogic.member.Member currentMember = umbraco.cms.businesslogic.member.Member.GetCurrentMember();

            DateTime now = DateTime.Now;

            var basketProperties = (from properties in obj_basket.OrderLines select properties).FirstOrDefault();

            string str_productName = basketProperties.ProductName.ToString();

            string str_userType = currentMember.getProperty("userType").Value.ToString();

            string str_orderTotal = Convert.ToDecimal(obj_basket.OrderTotal).ToString("N2");

            string str_orderId = obj_basket.OrderNumber.ToString();

            string str_vatNumber = currentMember.getProperty("vatNumber").Value.ToString();

            string str_firstName = obj_basket.BillingAddress.FirstName;

            string str_lastName = obj_basket.BillingAddress.LastName;

            string str_companyName = obj_basket.BillingAddress.CompanyName;

            string str_vat = basketProperties.VAT.ToString();

            string str_now = now.ToString("MMMM dd, yyyy");

     

     

        }

     

    The lines that are comented, are the ones that I used to print only the values of the querystring to the email body, leaving the rest of the code comented...

    As I said, this works in the browser, If I pass a orderNumber, through querystring, but not in the email body..

     

    Thank you in advance

  • Gonçalo Assunção 39 posts 68 karma points
    Jan 26, 2015 @ 19:34
    Gonçalo Assunção
    0

    Ok, I solved it...

     

    It was the currentMember.getproperty lines the cause of the error..  I comented them and the email worked just fine

  • Jesper Nielsen 141 posts 498 karma points
    Jan 27, 2015 @ 09:45
    Jesper Nielsen
    0

    Ok,

    Thanks for letting us know!

    The content of the email is retrieved as a call

    website => website

    and not

    customer => website

    Kind regards,
    Jesper 

  • Gonçalo Assunção 39 posts 68 karma points
    Jan 28, 2015 @ 16:30
    Gonçalo Assunção
    0

    Thank you Jesper!

     Made it work by getting the member through the email in the billing address..

     

     

     

  • Mads Due 11 posts 72 karma points
    Feb 03, 2015 @ 15:27
    Mads Due
    0

    Hi Gonçalo

    Would you please mark this question as solved.

    Thanks in advance.

    Mads Due 

Please Sign in or register to post replies

Write your reply to:

Draft