Copied to clipboard

Flag this post as spam?

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

  • Owen 123 posts 246 karma points
    Sep 15, 2011 @ 11:34

    Dynamic email template introduce

    First of all you need to familiar with Razor.

    You can consider dynamic email template as a macro that use Razor engine. 

    The difference between macro and dynamic email template are:

    1. In email template there is no current page, so you can't access umbraco content through currentPage

    2. Package provide a external method "Arguments" to retrieve arguments are passed to email template.

    There are two email sending method in package:

    1. automatically, In this way Arguments() will return a dynamic object contain 4 properties.

    Email - return current email to address

    EmailSource - return a value to indicated where is email to address come from. 

    1 -- email come from member group

    2 -- email come from subscribe

    MemberGroupID - return member group id if have

    SubscribeTypeID - return subscribe type unique id if have

    2. manually, In this way Arguments() will return a dynamic object you passed.

    Following is a sample:

    Dear @this.Arguments().Email:
    Thanks for your register. In order to complete your registration you need to verify your email address:
    Click to verify email address


  • Pete 213 posts 285 karma points
    Jan 31, 2012 @ 15:07

    Owen, could you post a quick code example of how a unsubscribe would work, when the unsubscribe link is on an email ?

  • Owen 123 posts 246 karma points
    Jan 31, 2012 @ 15:15


    There is a method on the class library.

    uWebzone.CampaignLetters.Services.library.UnSubscribe(string email)

    And you can put something like below in the email allow user to unsubscribe:

    <a href="{current user email address}" target="_blank">UnSubscribe</a>

    and in the unsubscribe.aspx page will has the code like below:

    var email = Request.QueryString["email"];
  • Paul Fowles 75 posts 184 karma points
    May 03, 2012 @ 13:33
    Paul Fowles


    How do you use subscribeTypeId? Apart from thisAgruments.Email  the other properties are empty how do you fill these propertties 

Please Sign in or register to post replies

Write your reply to: