HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Nice one!

I bet a lot of admins will love you for that!

I think there is one place that should be changed though:

public function Gdn_Dispatcher_BeforeDispatch_Handler($Sender) {
    require_once 'plugins/EmailTemplate/class.email.php';
}

To my understanding this will load your class on every page, which is not necessary. I'm sorry I don't know a better way either, but I would try to

a) drop that function completely and simply hope the framework uses your class instead of the Vanilla class or
b) ask hgtonight or x00 who usually know about factory magic or whatever is needed for that ;)

Comments

  • R_JR_J Admin
    edited January 2015

    [edit]
    ... or you might be absolutely right in your choice...
    http://vanillaforums.org/discussion/comment/206848#Comment_206848
    [/edit]

    ... and I have to correct myself once again! http://vanillaforums.org/discussion/comment/217676/#Comment_217676

  • =) , I'm going to remove that unnecesary method , thx for the info =)

  • This is AWESOME

  • AaronWebsteyAaronWebstey ✭✭✭
    edited January 2015

    Anyone know offhand how to add some line breaks into the actual message part? I.e., in the image below, it would be nice to see

    Testy Testerton sent you a message:

    test3

    Follow the link below to check it out:
    link here

  • peregrineperegrine MVP
    edited January 2015

    I can't test. but

    you could try "\n"

    or

    PHP_EOL

    or

    `br tags <br>  or  <br />   or  p tags <p>  </p>
    

    not sure which will work in the context of the code. At least one of the the three should work.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Yeah, the problem is that I can't edit that part of the message within the text boxes the plugin provides - i.e., the line breaks that normally get inserted by the system seem to be disappearing or something. Guess I'll have to look in the plugin code to see what's going on there.

  • I haven't tried the plugin. but those messages are usually tied to defintions and you can change the definition

    see the faq question regarding changing wording.

    http://vanillaforums.org/discussion/28420/faq/p1

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited January 2015

    you would put what you want in this definition presumably, and you could trying the options suggested above in this definition. Unless the tags etc are stripped.

         $Definition['EmailNotification'] = '%1$s
    
        Follow the link below to check it out:
        %2$s
    
        Have a great day!';
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • AaronWebsteyAaronWebstey ✭✭✭
    edited January 2015

    Thanks YAP, but looks like it's not the definitions. It appears as though the plugin's mailer class (specifically, the 'Message()' function) is either not escaping enough stuff, or too much stuff, or a little of both. I'll include 2 emails source views in case @guillermofr‌ wants them for debugging; I'm not sure I'll get time to look at the code much more today.

    Screencap of my template info attached. I'm sending a message that says 'test 9'.

    Message source with plugin enabled:

    To: AaronWebstey <email@gmail.com>
    Subject: [The Real Forum] TestyTesterton sent you a message.
    X-PHP-Originating-Script: 1722:class.phpmailer.php
    Date: Fri, 9 Jan 2015 18:20:03 +0000
    From: The Real Forum <admin@trstri.com>
    Message-ID: <83579486d23958e6a4d49ce1cc2ffa20@forum.trstri.com>
    X-Priority: 3
    X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
        boundary="b1_83579486d23958e6a4d49ce1cc2ffa20"
    X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
    X-AntiAbuse: Original Domain - gmail.com
    X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
    X-Filter-ID: s0sct1PQhAABKnZB5plbIZVYsWkhGwb/40/rbCO3Vv7kGTdKvxO0x6mba8/K5GhHQPGRrj1Se2CQ
     cFOL8iuJdYZniO87DUKtKiq/VZhx5sWvsBFYq/ev3rLCEhMAnWT87bv3V/t0E1LFr1NG8yMprsJz
     8WfReHqUOdh1n/PPcFw9TdW5qmxyOaFkFKhij1BfzW2iTMiJdOSRUqmMlAIoVFz1pRXWhjh9fdbl
     44I0Df2zi1AhrTmQha+OkAJTNOdMYhiC31TNbctUyhuQhRBIFRZRudLhU3wdXTvzjfr4MPrRA+kJ
     Q5wMpUj3D781oGvPPBfyCUQPGRfAuQJyQcUhQ4/Ia6YN5m0MsQWfYUYaa1IvMq0KDVXLb6VBQkBP
     sSqcbEtuwoEs2g2xMVkhLQDQBnY+akJNhL5qAttvzUBLxkQRf7vfz3yJTxlDBSwdAW3svy37UgzH
     QwXqkiL8QNBgVzHYLyvT6f3Q+BmtUtn7AttH1WsaGAOyYG3fZmqGXyhMKJyXruX+Y6ivUqs4BJMP
     66anMfHPEwyrd1R+9gs+vCBsS27CgSzaDbExWSEtANAGdfis1O0p6F7CmaTsN5I7su8ZJGP+UNHt
     E/CNdODkYXU8F/IJRA8ZF8C5AnJBxSFDe3MnMNe1bX2n6hImr+w81CAnXxc0P1+L8u6VVfd7lfT9
     dkF6OIFSqWkL+pAJBTMk+qHQQNhVQUwQs9o+1zOijIyC2sKwXa/eDM4t0fSZavsxL7hrJSk60SF3
     F6RYOYr2
    X-Report-Abuse-To: spam@quarantine.mailspamprotection.com
    X-Filter-Fingerprint: IFrWXGses7OKB5S5G8/dJb0kolOUiviGeQyDsBgQ6PBA3cTUQ1R++keuE7RDJ8Kg3RbMLUalw1oC
     mj99/u+Poh38tEMU4IgC4sNz49qn3HHnhRv/ZJ3kEy8bfiAr+Fb/UpndEJ0YoaLytXXo8BMTaX2p
     Mk7LBarWD9Fj4R3eIu5amSKkALoA6KDzkQ8jq89Qglr+eUaqsXi6ilYykBRNmy1w3rhXI7ypWHcC
     zReLskSoC1jzfYuYzO5TaopJL1l0EkXKTCB9mgAH2nNvM1GFDcH5C2MO7hTENZJE35bUvwA=
    X-SpamExperts-Outgoing-Class: unsure
    X-SpamExperts-Outgoing-Evidence: Combined (0.54)
    X-Recommended-Action: accept
    
    --b1_83579486d23958e6a4d49ce1cc2ffa20
    Content-Type: text/plain; charset = "utf-8"
    Content-Transfer-Encoding: quoted-printable
    
    TestyTesterton sent you a message.=0A=0Atest 9=0A=0A---=0AFollow the link b=
    elow to check it out:=0Ahttp://forum.trstri.com/messages/71#303=0A=0AHave a=
     great day!=20
    NOTE:=C2=A0Do not reply to this message. All replies will go to the forum a=
    dministrator, email@email.com.
    
    --b1_83579486d23958e6a4d49ce1cc2ffa20
    Content-Type: text/html; charset = "utf-8"
    Content-Transfer-Encoding: quoted-printable
    
    <a href=3D"http://forum.trstri.com"><img style=3D'width: 200px;' src=3D'htt=
    p://forum.trstri.com/uploads/CNN1QMFWVGQS.jpg' /></a> <br /><br />
     TestyTesterton sent you a message.=0A=0Atest 9=0A=0A---=0AFollow the link =
    below to check it out:=0Ahttp://forum.trstri.com/messages/71#303=0A=0AHave =
    a great day! <div style=3D'font-weight:light;'>
    <small><strong>NOTE:</strong>=C2=A0Do not reply to this message. All replie=
    s will go to the forum administrator, email@email.com.</small>
    </div>
    
    
    --b1_83579486d23958e6a4d49ce1cc2ffa20--
    

    Message source without plugin enabled:

    To: AaronWebstey <email@gmail.com>
    Subject: [The Real Forum] TestyTesterton sent you a message.
    X-PHP-Originating-Script: 1722:class.phpmailer.php
    Date: Fri, 9 Jan 2015 18:30:15 +0000
    From: The Real Forum <email@email.com>
    Message-ID: <3171c14deff8adecfd1e25512df7c893@forum.trstri.com>
    X-Priority: 3
    X-Mailer: PHPMailer 5.1 (phpmailer.sourceforge.net)
    MIME-Version: 1.0
    Content-Transfer-Encoding: quoted-printable
    Content-Type: text/plain; charset="utf-8"
    X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
    X-AntiAbuse: Primary Hostname - serv01.siteground168.com
    X-AntiAbuse: Original Domain - gmail.com
    X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
    X-Filter-ID: s0sct1PQhAABKnZB5plbIZVYsWkhGwb/40/rbCO3Vv7kGTdKvxO0x6mba8/K5GhHQPGRrj1Se2CQ
     cFOL8iuJdYZniO87DUKtKiq/VZhx5sWvsBFYq/ev3rLCEhMAnWT87bv3V/t0E1LFr1NG8yMprsJz
     8WfReHqUOdh1n/PPcFw9TdW5qmxyOaFkFKhij1Bf1e/2SF6crOgyd2Xd3A/vFlz1pRXWhjh9fdbl
     44I0Df2zi1AhrTmQha+OkAJTNOdMYhiC31TNbctUyhuQhRBIFRZRudLhU3wdXTvzjfr4MPrRA+kJ
     Q5wMpUj3D781oGvPPBfyCUQPGRfAuQJyQcUhQ4/Ia6YN5m0MsQWfYUYaa1IvMq0KDVXLb6VBQkBP
     sSqcbEtuwoEs2g2xMVkhLQDQBnY+akJNhL5qAttvzUBLxkQRf7vfz3yJTxlDBSwdAW3svy37UgzH
     QwXqkiL8QNBgVzHYLyvT6f3Q+BmtUtn7AttH1WsaGAOyYG3fZmqGXyhMKJyXruX+Y6ivUqs4BJMP
     66anMfHPEwyrd1R+9gs+vCBsS27CgSzaDbExWSEtANAGdfis1O0p6F7CmaTsN5I7su8ZJGP+UNHt
     E/CNdODkYXU8F/IJRA8ZF8C5AnJBxSFDe3MnMNe1bX2n6hImr+w81CAnXxc0P1+L8u6VVfd7lfT9
     dkF6OIFSqWkL+pAJBTMk+qHQQNhVQUwQs9o+1zOijIyC2sKwXa/eDM4t0fSZavsxL7hrJSk60SF3
     F6RYOYr2
    X-Report-Abuse-To: spam@quarantine.mailspamprotection.com
    X-Filter-Fingerprint: IFrWXGses7OKB5S5G8/dJb0kolOUiviGeQyDsBgQ6PBA3cTUQ1R++keuE7RDJ8Kg3RbMLUalw1oC
     mj99/u+Poh38tEMU4IgC4sNz49qn3HHnhRv/ZJ3kEy8bfiAr+Fb/UpndEJ0YoaLytXXo8BMTaX2p
     Mk7LBarWD9Fj4R3eIu5amSKkALoA6KDzkQ8jq89Qglr+eUaqsXi6ilYykBRNmy1w3rhXI7ypWHcC
     zReLskSoC1jzfYuYzO5TaopJL1l0EkXKTCB9mgAH2nNvM1GFDcH5C2MO7hTENZJE35bUvwA=
    X-Originating-IP: 184.154.226.11
    X-SpamExperts-Outgoing-Class: unsure
    X-SpamExperts-Outgoing-Evidence: Combined (0.46)
    X-Recommended-Action: accept
    
    TestyTesterton sent you a message.=0A=0Atest 9=0A=0A---=0AFollow the link b=
    elow to check it out:=0Ahttp://forum.trstri.com/messages/71#304=0A=0AHave a=
     great day!
    
  • peregrineperegrine MVP
    edited January 2015

    use the code tags when posting code or error messages. they are in the paragraph symbol on buttonbar

    it's been adjusted. I'll leave the image in case it helps someone else in the future.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited January 2015

    although it may not be the definitions in this case.

    its always a good idea to test if the definition is being looked at.

    So I usually test with "xx" easier to see if it is indeed reading definition. vs. tags or special characters.

    e.g.
    
         $Definition['EmailNotification'] = '%1$s
        Follow the link below to check it out:
        %2$s
        Have a great XX day!';
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Are you saying that you can't use html in the email ?

    See if you have this in your config.php

    $Configuration['Garden']['Email']['MimeType']= 'text/html';

  • peregrineperegrine MVP
    edited January 2015

    @AaronWebstey - you might want to remove or obfuscate some sensitive e-mail addresses, etc and names in your comment above to protect from s p a m

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @vrijvlinder‌ Thanks! I did not have that in there. Tried it, did not help :( I think it was actually sending HTML email. In fact, it's actually sending HTML and plain text versions, as opposed to the core mailer which just sends text/plain.

    @peregrine‌ thanks - I've removed my email addresses. Duh. Also, I have updated the locale file and yep, it's not getting looked at (I made it "have a Starkeriffic day" instead of "have a great day"). Hm, I'll have to see where that's coming from. Grep to the rescue!

  • peregrineperegrine MVP
    edited January 2015

    @AaronWebstey said:
    vrijvlinder‌ Thanks! I did not have that in there. Tried it, did not help :( I think it was actually sending HTML email. In fact, it's actually sending HTML and plain text versions, as opposed to the core mailer which just sends text/plain.

    peregrine‌ thanks - I've removed my email addresses. Duh. Also, I have updated the locale file and yep, it's not getting looked at (I made it "have a Starkeriffic day" instead of "have a great day"). Hm, I'll have to see where that's coming from. Grep to the rescue!

    simplest way.

    you need to put definitions in conf/locale.php and delete the ini files in your cache. -

    then click a page on your forum

    then you can also look at the contents of

    cache/locale_map.ini

    if your locale file is not listed you are not reading it !

    so if the cache/locale_map.ini

    so if it does not have a line with conf/locale.php"

    snip snip.... 
    
    ....
    
    
    4 = "/var/www/vanilla/conf/locale.php"
    

    that is your problem - the file is not being read.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine‌ tried adding locale.php, no dice. Still old string coming through. However, I noticed that there was a var called

    $Definition['EmailStoryNotification']

    Added that to conf/locale.php with the BR tags (and my updated 'have a starkeriffic day'), and voila!!

    Problem solved. TYAP (there should probably be a 'TYAP' reaction button).

  • As long as it stands for "Thank You Awesome People".... :)

  • AaronWebsteyAaronWebstey ✭✭✭
    edited January 2015

    @vrijvlinder‌ yeah of course, I guess there are a few of you out there who deserve their own button :) TYAV!

  • @AaronWebstey said:
    peregrine‌ tried adding locale.php, no dice. Still old string coming through. However, I noticed that there was a var called

    $Definition['EmailStoryNotification']

    Added that to conf/locale.php with the BR tags (and my updated 'have a starkeriffic day'), and voila!!

    Problem solved. TYAP (there should probably be a 'TYAP' reaction button).

    sorry, gave you wrong definition. believe it or not I came back online after I realized I probably gave you wrong definition. i gave you the confirmation one.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.