Question

I have a part defined below, and I have a content type which has this part. I'm using Rules to trigger an email to be send when an item of this content type is created.

I'm having difficulty accessing the fields on the part using Tokens. I've done some digging in the Tokens module and it appears it cannot directly access properties on the part, but only fields on the part.

Does anyone know how I can access these properties in the email body using Tokens? I've tried {Content.Name}, {Content.AddressChangeFormSubmission.Name} and many other different tokens with no success. I can access things like {Content.Id}, {Content.ContentType} with no problem though.

Thanks

public class AddressChangeFormSubmissionPart : ContentPart<AddressChangeFormSubmissionRecord>
{
    [Required]
    [Display(Name="Name")]
    public string Name
    {
        get { return Record.Name; }
        set { Record.Name = value; }
    }

    [Required, DataType(DataType.EmailAddress), EmailAttribute]
    public string Email
    {
        get { return Record.Email; }
        set { Record.Email = value; }
    }
}
Was it helpful?

Solution

A token needs to be explicitly exposed, and there is none out of the box for the body. Look at existing tokens for example on how to build your own.

OTHER TIPS

If you add a Projection Binding on this property 'Name' (in the Tab Bindings of Queries), may be you can retry {Content.AddressChangeFormSubmission.Name} next

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top