Sending system messages as plain text

I have setup campaign templates and everything is working OK with HTML including system messages (set to use the campaign template for system messages).

However when a user visits the subscribe page and chooses to subscribe but sets their preferred message format as plain text they get all the system messages as HTML. Is this correct or have I missed something obvious? I would have thought these should have obeyed the user preferences from the start.

I would also prefer admin messages (e.g. sending started / finished etc) as plain text but I can live with HTML.

Thanks

Alastair

1 Like

@scfnet My recollection is that system messages are sent in html or plain text depending on whether the system template itself looks like html or plain text.

I’ve tried a system template that just contains [content] but it still sends as html. It looks plain but still has the phplist image and the content is html. The message is multipart and there is a plain text part but I would prefer it to send just the plain text if the subscriber has selected plain text.

@scfnet Ah, it is based on whether the message content itself contains html. See function

function constructSystemMail($message, $subject = '')
{
    $hasHTML = strip_tags($message) != $message;
    $htmlcontent = '';

    if ($hasHTML) {
        $message = stripslashes($message);

So long as the system message content is only text then the email should be sent as plain text only.

Also, ensure that you define EMAILTEXTCREDITS to false in your config.php file.

Thanks, turned out that the template was HTML after all. I though I had gone into the source view and stripped out any tags but the [content] was surrounded by paragraph tags. Once these were removed it just sends plain text emails as system messages.

This is much better as it now only sends plain text system messages. It might be nice to be able to send the system messages in the users preferred format but that i
s a suggestion for the future.