Jump to:

10986 Posts in 2724 Topics by 1817 members

All other Modules

SilverStripe Forums » All other Modules » Sending a plain text newsletter

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2506 Views
  • SilverRay
    Avatar
    Community Member
    167 Posts

    Sending a plain text newsletter Link to this post

    I'm trying to send a plain text newsletter using the newsletter module. No matter what I do, even if I make all the send() functions in the newsletter module's code into sendPlain(), it still send out email with a mime part, like this:

    This is a multi-part message in MIME format.

    ------=_NextPart_198359570119
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: quoted-printable

    <p>This is a draft newsletter.</p>
    ------=_NextPart_198359570119--

    How can I make it so, that it sends out some old-fashioned text email? Thanks!

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: Sending a plain text newsletter Link to this post

    *bump*

    I am having the same problem myself.

    Can anyone tell me what's wrong?

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: Sending a plain text newsletter Link to this post

    Anybody..?

  • freedolin
    Avatar
    Community Member
    6 Posts

    Re: Sending a plain text newsletter Link to this post

    Hi _Vince

    try to create a second newsletter template. I guess this one will be in plain text.

    I raised that issue some time ago, but unfortunately without any responses.

    See here: http://silverstripe.org/all-other-modules/show/266217

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: Sending a plain text newsletter Link to this post

    Freedolin:

    Thanks for replying and yes, I've seen your post from a while back while I was looking for a solution.

    I don't understand your comment though: I can't create a second template in plain text because I can't have two files with the same name in the templates directory. Or am I missing something?

    I've managed to get a template happening but the email arrives blank. Unless I *don't* use a template, in which case Outlook displays all the tags.

    Not a very good day.

  • freedolin
    Avatar
    Community Member
    6 Posts

    Re: Sending a plain text newsletter Link to this post

    What I intended to say is:
    1) Make one template. (you have already one)
    2) Copy it and rename it.

    Now you have obviously two templates.

    If one sends a test newsletter using the 1st template then it will be HTML.
    If one sends a test newsletter using the 2nd template then it will be plain text.

    I underline: both templates are HTML-templates. Their only difference is their name.

  • _Vince
    Avatar
    Community Member
    161 Posts

    Re: Sending a plain text newsletter Link to this post

    Ahh... Now I understand. Thanks for the suggestion.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Sending a plain text newsletter Link to this post

    Just a heads up, I was dealing with this the other day and I discovered there's a bug in Silverstripe that will not allow you to send a plain text email. At least not through the Email class.

    The problem is the $attachedFiles property. The default value in the class is

    protected $attachedFiles = array();

    But in the sendPlain() function, there's a check for attached files

    if(is_array($attachedFiles))
    // change the content-type to "multipart"

    It should be checking if the array has a size -- not that it's just an array. Since the $attachedFiles property is protected, you can't modify its value from outside the class. Therefore, you're forced to have a multipart content-type.

    I've sent the bug to Silverstripe.

    2506 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.