Advertisement:

Author Topic: Notify Issue  (Read 29614 times)

Orstio

  • Guest

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #41 on: August 27, 2006, 02:10:16 PM »
Looking good

Quote
A reply has been posted to a topic you are watching by admin.

View the reply at:
http://www.mypcsecurity.ca/component/option,com_smf/Itemid,2/topic,17.new/topicseen,topicseen"#new

Unsubscribe to this topic by clicking here:
http://www.mypcsecurity.ca/component/option,com_smf/Itemid,2/action,notify/topic,17.0
More replies may be posted, but you won't receive any more notifications until
you read the topic.
Regards,__The MyPCSecurity.ca Team."

Now the only thing left is the "#new" at the end, but I see others have this problem as well.

Is there a fix?

Thank you for all your help Orstio!  :D

Orstio

  • Guest
Re: Notify Issue
« Reply #42 on: August 27, 2006, 02:13:39 PM »
I've updated the post.  Try it again?

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #43 on: August 27, 2006, 02:18:17 PM »
That did it! Thank you

What about the:
Quote
Regards,__The MyPCSecurity.ca Team."

Orstio

  • Guest
Re: Notify Issue
« Reply #44 on: August 27, 2006, 02:21:28 PM »
I'll work on those yet.  Hopefully this is acceptable, for now?

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #45 on: August 27, 2006, 02:27:52 PM »
This seems to work for reply notifications but I will have to test post and registration notifications
Quote
function integrate_outgoing_email($subject, &$message, $headers)
{
   global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid;
   
   $message = str_replace ($scripturl, '"="' . $scripturl, $message);
   $message = str_replace ('topicseen', 'topicseen"', $message);
   $message .= '"';
   $message = ob_mambofix($message);
   $message = str_replace ('"="', ' ', $message);
    $message = str_replace ('"#new', '#new', $message);
   $message = trim($message);
   $message = un_htmlspecialchars($message);
   $message = str_replace ('____', '

', $message );
   $message = str_replace ('__', '
', $message );
   $message = str_replace ('"', ' ', $message);
   return true;
}

Thank you for all your help

Orstio

  • Guest
Re: Notify Issue
« Reply #46 on: August 27, 2006, 02:30:22 PM »
Code: [Select]
   $message = str_replace ('"', ' ', $message);
See, that's one that I didn't really want to do, because it will cause problems if someone puts a double quote in their PM.

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #47 on: August 27, 2006, 02:35:19 PM »
Ok, I will remove for now and wait for a fix....

Thanks

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #48 on: August 27, 2006, 02:43:39 PM »
F.Y.I.

New Topic notifications look like this (Missing the "Unsubscribe to this..." part):
Quote
A new topic, 'test6', has been made on a board you are watching.

You can see it at
 http://www.mypcsecurity.ca/component/option,com_smf/Itemid,2/topic,22.new http://www.mypcsecurity.ca/component/option,com_smf/Itemid,2/action,notifyboard/board,1.0

Regards,
The MyPCSecurity.ca Team."

Registration notification looks good and Topic Reply notifications have the quote at the end (but I can live with that)...
« Last Edit: August 27, 2006, 02:45:51 PM by samyot »

Orstio

  • Guest
Re: Notify Issue
« Reply #49 on: August 27, 2006, 02:48:44 PM »
Code: [Select]
function integrate_outgoing_email($subject, &$message, $headers)
{
global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid;

$message = str_replace ($scripturl, '"="' . $scripturl, $message);
$message = str_replace ('#new', '"#new', $message);
$message .= '"="';
$message = ob_mambofix($message);
$message = str_replace ('"="', ' ', $message);
$message = str_replace ('"#new', '#new', $message);
$message = trim($message);
$message = un_htmlspecialchars($message);
$message = str_replace ('____', '
', $message );
return true;
}

Offline samyot

  • Semi-Newbie
  • *
  • Posts: 82
    • MyTechSupport.ca
Re: Notify Issue
« Reply #50 on: August 27, 2006, 02:57:09 PM »
Perfect! Thank you.

Topic Reply and New Topic are working fine!

My final code:
Quote
function integrate_outgoing_email($subject, &$message, $headers)
{
   global $boardurl, $mosConfig_live_site, $Itemid, $scripturl, $mosConfig_sef, $modSettings, $Itemid;
   
   $message = str_replace ($scripturl, '"="' . $scripturl, $message);
   $message = str_replace ('#new', '"#new', $message);
   $message .= '"="';
   $message = ob_mambofix($message);
   $message = str_replace ('"="', ' ', $message);
   $message = str_replace ('"#new', '#new', $message);
   $message = trim($message);
   $message = un_htmlspecialchars($message);
   $message = str_replace ('____', '

', $message );
   $message = str_replace ('__', '
', $message );
   return true;
}

Offline phil_roy

  • Jr. Member
  • **
  • Posts: 146
Re: Notify Issue
« Reply #51 on: August 27, 2006, 05:15:00 PM »
Perfect for me too...thanks Orstio!

Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

Offline alexasc

  • Semi-Newbie
  • *
  • Posts: 26
Re: Notify Issue
« Reply #52 on: September 03, 2006, 08:12:56 AM »
I had the same problem, but after changing the function, it works perfectly in Outlook. But in Gmail though, the link still don't work. Here is how it looks like:



You can see that a part of the header is included in the mail body, and that undercore (_) becomes =5F. Other special characters are also changed in this way.

I have seen this problem mentioned in other posts, but haven't really found a solution.

Any ideas?
Thanks

Offline skydig

  • Semi-Newbie
  • *
  • Posts: 18
  • Gender: Male
    • Antillavia.com
Re: Notify Issue
« Reply #53 on: September 03, 2006, 09:57:31 AM »
Hello all,

If you find that notification emails show weird characters or if you see headers in the email like this:

Quote
Message-ID: <e101b7749d4914dc73e5362b285d42b6-p1917@andraste-guilde.com>

X-Mailer: SMF

Content-Type: text/plain; charset=UTF-8

Content-Transfer-Encoding: quoted-printable

Vous venez tout juste de recevoir un message personnel de la part de admin sur Andraste .



IMPORTANT: Rappelez-vous que ceci n'est qu'une notification.  Ne r=C3=A9pondez pas =C3=A0 ce courriel.



Le message qui vous a =C3=A9t=C3=A9 envoy=C3=A9 est le suivant:



=C3=A0=C3=A0=C3=A9=C3=A0=C3=A9=C3=A0=C3=A9

=C3=A9=C3=A0=C3=A9=C3=A0



sdfsfs



R=C3=A9pondez =C3=A0 ce message personnel ici: http://www.andraste-guilde.com/forum/index.php=3Faction=3Dpm;sa=3Dsend;f=3Dinbox;pmsg=3D1917;quote;u=3D1 [nofollow]

You can try to modify the following lines:

In Subs-Post.php file (located in SMF "Sources" folder):

Find:
Line 564
Code: [Select]
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . ">\r\n";
Change to:
Code: [Select]
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . ">\n";
Find:
Line 565
Code: [Select]
$headers .= $from !== null ? 'Reply-To: <' . $from . ">\r\n" : '';
Change to:
Code: [Select]
$headers .= $from !== null ? 'Reply-To: <' . $from . ">\n" : '';
Find:
Line 566
Code: [Select]
$headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email: $modSettings['mail_from']) . "\r\n";
Change to:
Code: [Select]
$headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email: $modSettings['mail_from']) . "\n";
Find:
Line 567
Code: [Select]
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' +0000' . "\r\n";
Change to:
Code: [Select]
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' +0000' . "\n";
Find:
Line 570
Code: [Select]
$headers .= 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $message_id . strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@') . ">\r\n";
Change to:
Code: [Select]
$headers .= 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $message_id . strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@') . ">\n";
Find:
Line 571
Code: [Select]
$headers .= "X-Mailer: SMF\r\n";
Change to:
Code: [Select]
$headers .= "X-Mailer: SMF\n";
Find:
Line 589
Code: [Select]
$headers .= 'Mime-Version: 1.0' . "\r\n";
Change to:
Code: [Select]
$headers .= 'Mime-Version: 1.0' . "\n";
Find:
Line 590
Code: [Select]
$headers .= 'Content-Type: multipart/alternative; boundary="' . $mime_boundary . '"' . "\r\n";
Change to:
Code: [Select]
$headers .= 'Content-Type: multipart/alternative; boundary="' . $mime_boundary . '"' . "\n";
Find:
Line 612
Code: [Select]
$headers .= 'Content-Type: text/plain; charset=' . $charset . "\r\n";
Change to:
Code: [Select]
$headers .= 'Content-Type: text/plain; charset=' . $charset . "\n";
Find:
Line 642
Code: [Select]
$mail_result = $mail_result && smtp_mail($to_array, $subject, $message, $send_html ? $headers : "Mime-Version: 1.0\r\n" . $headers);
Change to:
Code: [Select]
$mail_result = $mail_result && smtp_mail($to_array, $subject, $message, $send_html ? $headers : "Mime-Version: 1.0\n" . $headers);


This should work it out!
@ pliss

Offline alexasc

  • Semi-Newbie
  • *
  • Posts: 26
Re: Notify Issue
« Reply #54 on: September 03, 2006, 10:55:05 AM »
Great, now it works fine even in Gmail.

Thanks a lot  :D

Offline phil_roy

  • Jr. Member
  • **
  • Posts: 146
Re: Notify Issue
« Reply #55 on: September 07, 2006, 07:02:31 PM »
Orstio,

Does the code hack you posted also affect notification of account activation? I've just had a user send me a problem re registering and when I tried, I noticed a slight formatting issue with the email that came out. If you see below, the post notification is OK, with the exception of lack of line breaks...but the notification of account activation has a small issue.



Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

Orstio

  • Guest
Re: Notify Issue
« Reply #56 on: September 07, 2006, 07:29:39 PM »
It will affect all outgoing emails, not just topic notifications.

It's odd that the line break is not cutting off the link...

Offline phil_roy

  • Jr. Member
  • **
  • Posts: 146
Re: Notify Issue
« Reply #57 on: September 07, 2006, 07:44:50 PM »
OK..yes very odd. Any suggestions?

Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community

Orstio

  • Guest
Re: Notify Issue
« Reply #58 on: September 07, 2006, 07:50:20 PM »
In Login.english.php, find this:

Code: [Select]
$txt['register_activate_message'] = 'You are now registered with an account at ' . $context['forum_name'] . ', %1$s!' . "\n\n" . 'Your account\'s username is %2$s and its password is %3$s (which can be changed later.)' . "\n\n" . 'Before you can login, you first need to activate your account. To do so, please follow this link:' . "\n\n" . '%5$s' . "\n\n" . 'Should you have any problems with activation, please use the code "%4$s".' . "\n\n" . $txt[130];

Try this:

Code: [Select]
$txt['register_activate_message'] = 'You are now registered with an account at ' . $context['forum_name'] . ', %1$s!' . "\n\n" . 'Your account\'s username is %2$s and its password is %3$s (which can be changed later.)' . "\n\n" . 'Before you can login, you first need to activate your account. To do so, please follow this link:' . "\n\n" . '%5$s' . "\n\n" . '    Should you have any problems with activation, please use the code "%4$s".' . "\n\n" . $txt[130];

Offline phil_roy

  • Jr. Member
  • **
  • Posts: 146
Re: Notify Issue
« Reply #59 on: September 07, 2006, 08:20:06 PM »
Awesome! Works a treat! Thanks  ;)

Phil
http://www.nzmac.com
NZMac.com - Supporting the New Zealand Mac community