Opened 6 years ago

Closed 6 years ago

#1848 closed bug (fixed)

plain text email notifications should not contain HTML tags

Reported by: globetrotter_tt Owned by: dima42
Priority: minor Milestone: 1.6
Component: BW Mail Keywords: email, notifications, HTML
Cc:

Description

User feedback:

The plain/text version of your signup confirmation email has HTML br tags in it. There should be none. (The HTML version is fine but I and, I suppose, at least some others prefer plaintext emails).

Example: http://x.unix.se/etc/bewelcome_plaintext.png

Change History (24)

comment:1 Changed 6 years ago by shevek

Probably releated to #1827.

comment:2 Changed 6 years ago by jsfan

Deployed on alpha.

comment:3 Changed 6 years ago by dima42

  • Status changed from new to local_testing

comment:4 Changed 6 years ago by shevek

Care to add this to 1.6? (Actually it is probably not useless as jsfan pointed out in #1860)

comment:5 Changed 6 years ago by dima42

  • Status changed from local_testing to needs_work

comment:6 Changed 6 years ago by dima42

  • Owner set to dima42
  • Status changed from needs_work to assigned

comment:7 Changed 6 years ago by dima42

  • Status changed from assigned to local_testing

comment:8 Changed 6 years ago by dima42

  • Milestone changed from unassigned to 1.6

actually we send mail in two places (one for sign-ups, and one for members). the following commit fixes the tags in the other place. (use both this one and previous one)

https://gitorious.org/~dima42/bewelcome/dima42-sandbox/commit/ed357d6a0da6988ef1d29de6644a3c3ec61f1e68

comment:10 Changed 6 years ago by midsch

I don't know if this can be tested with bwubuntu, but for me it looks fine. (There is another mail, for adminacceptor to accept the member that still contains linebreakes, but that's obsolete anyway.) And yes, I prefer plain textmails and will be happy when links are not hidden in html-tag and become usable!

Below the text part of a mail after signup that's dumped into /tmp (instead of really sending it):

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

Hello test midsch! Thank you for your interest in becoming a member = of BeWelcome.=20 In order to accept you, we need you to confirm your e= mail address. Simply click on the link below. http://localhost/sign= up/confirm/testmidsch3/2c100e3506ab6a31

Many greetings from t= he BW team and.... ...be welcome!

--_=_swift_v4_1363036437513e491543ba3_=_

comment:11 Changed 6 years ago by shevek

@midsch: Could you check how the send messages look like?

comment:12 Changed 6 years ago by midsch

Nope. After sending mails to another member, there is nothing in /tmp. Only the signup mails go to /tmp.

As I mentioned earlier in another ticket (the delete-messages-bug), sent-mails are not listed in my sent folder any more. Dima42 pointed out the reasons for it (but it kinda sucks for testing). I can tweak this by changing the message status via phpmyadmin to "send", to test in mailboxes. But this doesn't help here.

I'm still using my "old" setup, which should do. But I'm also downloading the latest bwbuntu and try it again later.

comment:13 Changed 6 years ago by shevek

@midsch: not sure if this works (don't have a bwbuntu myself): Open a terminal change to the directory rox is located and call

php htdocs\bw\mailbot.php

This should actually send the mails (putting them into the /tmp folder.

comment:14 Changed 6 years ago by midsch

(Yeah, and there are really good reasons not to use standard Ubuntu. This surface completley sucks.)

Anyway:
root@bwubuntu:/var/www/rox# git pull
Already up-to-date.
root@bwubuntu:/var/www/rox# php htdocs\bw\mailbot.php
Could not open input file: htdocsbwmailbot.php

But:
root@bwubuntu:/var/www/rox/htdocs/bw# php mailbot.php
sent a lot of stuff to /tmp

I'll check and report.

Last edited 6 years ago by midsch (previous) (diff)

comment:15 Changed 6 years ago by shevek

Of course the shell command should have used / instead of \...

comment:16 Changed 6 years ago by midsch

Oh. That's so obvious, I just overlooked it. (I put the hint on the bwbuntu wikipage later.)

My last mail looks fine regarding the br-tags, so this is ready.

But at the end you get something like: Reply to the message Visit the profile of $sender Check your BeWelcome inBox

These are the link titles, that's completely useless, instead the real http-links should be shown in plain textmails. Can we fix it here or shall I open a new ticket?

comment:17 Changed 6 years ago by dima42

i'll fix it in a moment.

some more notes: in the html version of the mail, there is a phrase "greetings from the volunteers" in blue at the end of the message. why is that there? how do people feel about it being deleted and/or turned not-blue?

also "inBox" seems like weird capitalization, so i'll change that unless someone objects.

comment:18 Changed 6 years ago by shevek

@dima: The greetings from the volunteers doesn't make much sense as far as I can see. I vote for deletion.

The link list is translatable, isn't it? Then you would need to alter the translation instead of the code.

comment:19 Changed 6 years ago by dima42

ok, so to clarify my earlier changes were not at all related to mail between members. it was only related to the mail from admin to members. the "<br>" issue did not exist in inter-member mail even before this commit. (see htdocs/bw/lib/mailer.php:82-83)

@shevek: yes. on some level this is all a translation issue. but on the other hand we want the same translation to work for both html and plaintext.

greetings from the volunteers comes from "HCVolMailSignature" and is included in htdocs/bw/lib/mailer.php:136/160 (which happens to apply to html-only mail because of a bug)

inBox and the link list comes from "mailbot_YouveGotAMailText" and is included in mailbot.php:395. for plain-text emails the links are deleted in htdocs/bw/lib/mailer.php:236

anyway, the commit i'm uploading fixes the link stripping with a hack, removes the reference to HCVolMailSignature, and fixes the bug where a greeting passed to bw_mail would be sent in html but not plaintext. i'm not sure if any greetings other than HCVolMailSignature exist, so that might be pointless :p.

https://gitorious.org/bewelcome/rox/commit/83741569e52467c5afae4b53e495fecdddc43de7

comment:20 Changed 6 years ago by midsch

Yes, reading the ticket again, it wasn't about member2member mails. But the link in these mails also look fine know.

comment:21 Changed 6 years ago by shevek

  • Status changed from local_testing to to_alpha

Status change to alpha.

comment:22 Changed 6 years ago by shevek

  • Status changed from to_alpha to testing

comment:23 Changed 6 years ago by midsch

No Linebreaks in member2members, forum/groupmails & new-password-mails are gone, the links are not stripped. (I'm to tired to do another signup tonight and for the first one I've used a disposable mail shown on a webmail.)

comment:24 Changed 6 years ago by sitatara

  • Resolution set to fixed
  • Status changed from testing to closed

Since I made a new test profile today for the gender issue I can confirm that the plain text signup message no longer shows any html tags.

Note: See TracTickets for help on using tickets.