LaunchEmail class and optional template

From the docs I read that LaunchEmail class “Launch the default email application with an optional template” but I can’t find any information about this optional template: what is for, how it works… Is it usefull to format the body of the mail message?

Actually I’m trying to simply add some line feeds/line breaks to the e-mail message string as the HTML <br/> but it does not work as it is converted to string. So for example:

I write in the mail 'message' string:
Hello<br/>world!

expected output:
Hello
world!

actual output:
Hello<br/>world!

So I thought that the optional template could help me to format the body of the e-mails. Is there any code snippet or example to understand how it works?

I’m afraid the “template” here means just the pre-filled To/Text properties. I don’t think it’s supposed to accept HTML though; did you try using \n instead of <br /> for the line breaks?

Hi Uldis,

I tried as you suggested, but unfortunately \n does not work.

Thank you.

Tested and found a workaround by using JavaScript:

<App>
    <JavaScript>
    var msg = "Hello\n\nWorld!";
    module.exports = {
        msg: msg
    };
    </JavaScript>
    <StackPanel Margin="20">
        <Button Margin="10" Text="Send email">
            <Clicked>
                <LaunchEmail To="email@example.com" Subject="Test" CarbonCopy="" BlindCarbonCopy="" Message="{msg}" />
            </Clicked>
        </Button>
    </StackPanel>
</App>