Loading...
 

Tikiwiki-devel (mailman list mirror)


Newsletter 'Reply to' email option - partial fix

posts: 829 United Kingdom

Hi - I've just made this commit to sort out the replyto email option in
Newsletters which wasn't working (not sure how it could have ever worked??)
but this commit is not sufficient when the Newsletter throttling option is
used, since when the send resumes the replyto data is lost so only the first
batch of 'throttled' newsletters are correctly sent with a replyto email
address.

I've identified what else needs to be done but I'm having a bit of a problem
getting it to work as my javascript/jquery knowledge is 'thin' to say the
least ! So I'm hoping someone can give me some advice.

For the throttle option there is some jquery code in
tiki-send_newsletters.tpl (lines 150-161) where the send is resumed by using
a var defined in line 155 ie

var url = 'tiki-send_newsletters.php?resume=' + $(this).data('edition');

The $(this).data('edition') part somehow retrieves the current editionId and
then 'tiki-send_newsletters.php retrieves the edition data from the database
to send the next batch of emails. But the edition data in the database does
not have the replyto information - and never has so far as I can tell and
indeed it isn't logical to store this with it - which is why the 58041
commit was needed.

So one way to sort this would be to extend the var url , for the case where
a replyto address has been set, to include the replyto data ie along the
lines of:

var url = 'tiki-send_newsletters.php?resume=' + $(this).data('edition') +
'&replyto=' + $(this).data('repylto');

If (just to test out the principle) I hard code the replyto additional
element with a fixed email address I can get everything to work, but since I
don't quite understand how the $(this).data('edition') part works I've not
been able to sort out this further replyto element

Any suggestions/help much appreciated so I can complete this fix and then
backport it to Tiki12 which is where I need it right now - I would also like
to add a new Newsletter option to be able to set a different send email
address on a per sending basis since at the moment all Newsletters are
always sent from the 'fixed' system email address which doesn't always make
sense - but that's next on my list!

Cheers

Geoff




-----Original Message-----
From: eromneg at users.sourceforge.net mailto:eromneg@users.sourceforge.net
Sent: 21 March 2016 09:42
To: tikiwiki-cvs at lists.sourceforge.net
Subject: Tikiwiki-cvs/svn SF.net SVN: tikiwiki:58041
branches/15.x/lib/newsletters/nllib.php

Revision: 58041
http://sourceforge.net/p/tikiwiki/code/58041
Author: eromneg
Date: 2016-03-21 09:42:04 +0000 (Mon, 21 Mar 2016)
Log Message:
-----------
FIX the 'reply to' email option was not passing the data through the
various steps. This commit does not completely fix the problem if the
'throttling' option is being used as the 'resumed' steps lose the replyto
content - needs a further change in the .tpl file

Modified Paths:
--------------
branches/15.x/lib/newsletters/nllib.php

Modified: branches/15.x/lib/newsletters/nllib.php
=============


58040)

+++ branches/15.x/lib/newsletters/nllib.php 2016-03-21 09:42:04 UTC (rev

58041)
@@ -1230,7 +1230,7 @@
return $retval;
}

- private function get_edition_mail($editionId, $target, $is_html =
null)

+ private function get_edition_mail($editionId, $target, $is_html = +null, $replyTo=null)

{
global $prefs, $base_url;
static $mailcache = array();
@@ -1303,8 +1303,8 @@
$zmail = tiki_get_admin_mail();
$emailMimeParts = array();

- if (!empty($info'replyto')) {
- $zmail->setReplyTo($info'replyto');

+ if (!empty($replyTo)) { + $zmail->setReplyTo($replyTo);

}

foreach ($info'files' as $f) {
@@ -1453,7 +1453,7 @@
}

try {
- $zmail =
$this->get_edition_mail($info'editionId', $us, $info'is_html');

+ $zmail =

$this->get_edition_mail($info'editionId', $us,

+$info'is_html', $info'replyto');

if (!$zmail) {
continue;
}

This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.


----------------------------------------------------------------------------
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with Intel Data Analytics
Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
___
Tikiwiki-cvs mailing list
Tikiwiki-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7497 / Virus Database: 4542/11857 - Release Date: 03/21/16



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7497 / Virus Database: 4542/11857 - Release Date: 03/21/16


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
___
TikiWiki-devel mailing list
TikiWiki-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel

posts: 829 United Kingdom

Ah - I think I see how this is done now having just spotted line 1492 in
nllib.php :-)

More soon hopefully

Cheers

g

-----Original Message-----
From: Geoff - Enmore Services mailto:geoff@enmoreservices.com
Sent: 21 March 2016 10:18
To: 'Tiki developers' <tikiwiki-devel@lists.sourceforge.net>
Subject: Newsletter 'Reply to' email option - partial fix

Hi - I've just made this commit to sort out the replyto email option in
Newsletters which wasn't working (not sure how it could have ever worked??)
but this commit is not sufficient when the Newsletter throttling option is
used, since when the send resumes the replyto data is lost so only the first
batch of 'throttled' newsletters are correctly sent with a replyto email
address.

I've identified what else needs to be done but I'm having a bit of a problem
getting it to work as my javascript/jquery knowledge is 'thin' to say the
least ! So I'm hoping someone can give me some advice.

For the throttle option there is some jquery code in
tiki-send_newsletters.tpl (lines 150-161) where the send is resumed by using
a var defined in line 155 ie

var url = 'tiki-send_newsletters.php?resume=' + $(this).data('edition');

The $(this).data('edition') part somehow retrieves the current editionId and
then 'tiki-send_newsletters.php retrieves the edition data from the database
to send the next batch of emails. But the edition data in the database does
not have the replyto information - and never has so far as I can tell and
indeed it isn't logical to store this with it - which is why the 58041
commit was needed.

So one way to sort this would be to extend the var url , for the case where
a replyto address has been set, to include the replyto data ie along the
lines of:

var url = 'tiki-send_newsletters.php?resume=' + $(this).data('edition') +
'&replyto=' + $(this).data('repylto');

If (just to test out the principle) I hard code the replyto additional
element with a fixed email address I can get everything to work, but since I
don't quite understand how the $(this).data('edition') part works I've not
been able to sort out this further replyto element

Any suggestions/help much appreciated so I can complete this fix and then
backport it to Tiki12 which is where I need it right now - I would also like
to add a new Newsletter option to be able to set a different send email
address on a per sending basis since at the moment all Newsletters are
always sent from the 'fixed' system email address which doesn't always make
sense - but that's next on my list!

Cheers

Geoff




-----Original Message-----
From: eromneg at users.sourceforge.net mailto:eromneg@users.sourceforge.net
Sent: 21 March 2016 09:42
To: tikiwiki-cvs at lists.sourceforge.net
Subject: Tikiwiki-cvs/svn SF.net SVN: tikiwiki:58041
branches/15.x/lib/newsletters/nllib.php

Revision: 58041
http://sourceforge.net/p/tikiwiki/code/58041
Author: eromneg
Date: 2016-03-21 09:42:04 +0000 (Mon, 21 Mar 2016)
Log Message:
-----------
FIX the 'reply to' email option was not passing the data through the
various steps. This commit does not completely fix the problem if the
'throttling' option is being used as the 'resumed' steps lose the replyto
content - needs a further change in the .tpl file

Modified Paths:
--------------
branches/15.x/lib/newsletters/nllib.php

Modified: branches/15.x/lib/newsletters/nllib.php
=============


58040)

+++ branches/15.x/lib/newsletters/nllib.php 2016-03-21 09:42:04 UTC (rev

58041)
@@ -1230,7 +1230,7 @@
return $retval;
}

- private function get_edition_mail($editionId, $target, $is_html =
null)

+ private function get_edition_mail($editionId, $target, $is_html = +null, $replyTo=null)

{
global $prefs, $base_url;
static $mailcache = array();
@@ -1303,8 +1303,8 @@
$zmail = tiki_get_admin_mail();
$emailMimeParts = array();

- if (!empty($info'replyto')) {
- $zmail->setReplyTo($info'replyto');

+ if (!empty($replyTo)) { + $zmail->setReplyTo($replyTo);

}

foreach ($info'files' as $f) {
@@ -1453,7 +1453,7 @@
}

try {
- $zmail =
$this->get_edition_mail($info'editionId', $us, $info'is_html');

+ $zmail =

$this->get_edition_mail($info'editionId', $us,

+$info'is_html', $info'replyto');

if (!$zmail) {
continue;
}

This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.


----------------------------------------------------------------------------
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with Intel Data Analytics
Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
___
Tikiwiki-cvs mailing list
Tikiwiki-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7497 / Virus Database: 4542/11857 - Release Date: 03/21/16



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7497 / Virus Database: 4542/11857 - Release Date: 03/21/16


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
___
TikiWiki-devel mailing list
TikiWiki-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel


Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.