FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » How to include ALL of text in email notifications to those subscribed to a topic?
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
icon5.gif  How to include ALL of text in email notifications to those subscribed to a topic? [message #31787] Thu, 18 May 2006 03:44 Go to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Good afternoon!

Can someone please clarify this for me:

When a member of a message board replies to a post, an email notification is sent to those who are subscribed to that topic.

What setting in what section of the the ACP allows me to make sure that the email notification includes ALL of the message? i.e. all the text of the message board post.

Thanks.

Smile



CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org

[Updated on: Thu, 18 May 2006 03:56]

Report message to a moderator

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31806 is a reply to message #31787] Fri, 19 May 2006 03:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
There is no such option.

FUDforum Core Developer
icon5.gif  Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31809 is a reply to message #31806] Fri, 19 May 2006 06:11 Go to previous messageGo to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Ilia wrote on Fri, 19 May 2006 13:00

There is no such option.


Hmm ... maybe I haven't explained the issue well enough.

Here is a screenshot of the email notification I just received from you. It does not include the text of your reply:

http://the1776.org/screencap07.jpg

But here is a screenshot of an email notification I received from one of the sites I have set up to test and get familiar with FUDForum:

http://the1776.org/screencap08.jpg

See? It includes the complete text of the reply AND replicates all the formatting.

This is what I like.

However, I don't know why the test site delivers the email notifications in this way - including all of the text and formatting - on my old FUDForum test site, but it doesn't do it on my new FUDForum discussion board.

Any thoughts on this?

Thanks for your help.

Smile




CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31810 is a reply to message #31809] Fri, 19 May 2006 14:00 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
To enable what you are seeing from the other site you need to enable the full-body notification option. It is an option inside the e-mail sub-section of the forum settings.

FUDforum Core Developer
icon5.gif  Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31835 is a reply to message #31810] Sat, 20 May 2006 00:08 Go to previous messageGo to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Ilia wrote on Sat, 20 May 2006 00:00

To enable what you are seeing from the other site you need to enable the full-body notification option. It is an option inside the e-mail sub-section of the forum settings.


Aha! I found it.

ACP >> [Under "Email Settings"] >> Notify W/Body: Include the message body and subject inside the email notification. [Set to "Yes"]

Thanks. Smile

Now I have a further, related question.

Margaret writes a post on the message board.

Ronald replies to it.

At this point, a "full-body notification" is sent to Margaret. (Unless Margaret had unticked the checkbox called "Post Notification: Notify me when someone replies to this message.")

But Mikhail receives nothing. He is a subscriber on the message board, but because he has not been part of the above exchange, he is not subscribed to the topic and therefore receives nothing.

On one of my message boards I would like ALL registered users to receive "full-body notifications" of ALL posts.

As Margaret and Ronald are discussing a topic, Mikhail and all forum members receives "full-body notifications" of ALL the discussions.

In broad terms, how can this be done please?

What type of alteration would be needed to the FUDForum script? Which file would need to be examined and altered to allow this behavior?

Thank you for any suggestions and directions.

Smile




CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31848 is a reply to message #31835] Sat, 20 May 2006 19:44 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
To notify users on all messages you need to adjust the notification code inside imsg_edt.inc.t to make the forum subscription act as a subscription to all the topics inside the forum as well.

FUDforum Core Developer
icon14.gif  Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31852 is a reply to message #31848] Sat, 20 May 2006 23:00 Go to previous messageGo to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Ilia wrote on Sun, 21 May 2006 05:44

To notify users on all messages you need to adjust the notification code inside imsg_edt.inc.t to make the forum subscription act as a subscription to all the topics inside the forum as well.


Thanks you very much for clarifying this matter!

Smile




CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31854 is a reply to message #31852] Sun, 21 May 2006 00:30 Go to previous messageGo to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Ilia wrote on Sun, 21 May 2006 05:44

To notify users on all messages you need to adjust the notification code inside imsg_edt.inc.t to make the forum subscription act as a subscription to all the topics inside the forum as well.


Sorry to bother you again Embarassed but where do I find imsg_edt.inc.t ?

I've gone into my ACP

Under "General Management" I click on "File Manager"

But I don't know where to go next.

Thanks for your help.


CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31856 is a reply to message #31854] Sun, 21 May 2006 03:23 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
It can be found inside the src/ directory.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #31857 is a reply to message #31856] Sun, 21 May 2006 05:57 Go to previous messageGo to next message
prodos is currently offline  prodos   Australia
Messages: 58
Registered: August 2005
Location: Melbourne, Australia
Karma: 0
Member

Ilia wrote on Sun, 21 May 2006 13:23

It can be found inside the src/ directory.


Ah! Found it!

>> ACP
>> [under "General Management"] File Manager
>> [click link at top of page called "DATA_ROOT: ... "]
>> scr
>> imsg_edt.inc.t

Thanks very much. Smile



CelebrateCapitalism.ORG
"Why? Because I own my life!"

* * * * * * * * * * * * * * * * *

phpBB? Invision Power Board? vBulletin?
Yes, all excellent. But The FUD is my favorite! Try it now @ http://FUDForum.org
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33097 is a reply to message #31857] Fri, 11 August 2006 19:33 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
prodos wrote on Sun, 21 May 2006 07:57

Ilia wrote on Sun, 21 May 2006 13:23

It can be found inside the src/ directory.


Ah! Found it!

>> ACP
>> [under "General Management"] File Manager
>> [click link at top of page called "DATA_ROOT: ... "]
>> scr
>> imsg_edt.inc.t

Thanks very much. Smile




Sorry to bother you. I'm also interested in this modification, but don't have as much experience as prodos. What exactly should be done to make the mod?

Thanks.

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33098 is a reply to message #33097] Fri, 11 August 2006 20:37 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You need to enable full body notification option in forum's settings.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33100 is a reply to message #33098] Fri, 11 August 2006 21:13 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Sorry. I guess I should more clear...and perhaps it has been answered in another posting elsewhere.

Is there any way to send a notification to everyone subscribed to a forum when there is a response or new posting? When subscribed to the forum, I only seem to get notifications when someone responds to my posting. Moreover, I am the only one who seems to get the notification. The problem is that if there are 3 or more of us using the forum, the only one of us will get notified, leaving everyone else out of the loop.



Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33116 is a reply to message #33100] Sat, 12 August 2006 16:17 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You need to enable the "All Message Forum Notification" option.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33134 is a reply to message #33116] Sat, 12 August 2006 19:18 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Ilia wrote on Sat, 12 August 2006 18:17

You need to enable the "All Message Forum Notification" option.


Hi Ilia,
Thanks for the quick response. Where can I find this option? I am using the EGW version of FudForum.

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33135 is a reply to message #33134] Sat, 12 August 2006 19:20 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Ah... then you don't have it, sorry.

The option can only be found in the stock version of FUDforum.


FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33155 is a reply to message #33135] Mon, 14 August 2006 08:07 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Sad .
Is there a mod or a quick fix I can apply to make it work as default....or would it be too complicated?

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33158 is a reply to message #33155] Mon, 14 August 2006 14:54 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You can tweak imsg_edt.inc.t to do this, given that tweak is already found in stock Fudforum, the tweak should not be overly complex to make.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33188 is a reply to message #33158] Wed, 16 August 2006 16:24 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
I've been trying to install the full version of fudforum on my linux box (suse 10.1, XAMPP for Linux 1.5.3a, PHP 5.1.4) to take a look at the imsg_edt.inc.t in the full version.... and I've have run into a problem that sounds a lot like the one in

http://fudforum.org/forum/index.php?t=msg&goto=30787

I can't get much beyond the ???'s when calling install.php. Is there a fix for this?

Though, I would rather install for php5, if I install fudforum for php4, will the imsg_edt.inc.t script work in fudforum for EGW using php5?

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33205 is a reply to message #33188] Thu, 17 August 2006 13:32 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
First try to install FUDforum 2.7.6RC1 and 2nd make sure that mbstring function overload is disabled. Also see if your PHP was compiled with zend-multibyte support.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33210 is a reply to message #33205] Thu, 17 August 2006 16:48 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Ilia wrote on Thu, 17 August 2006 15:32

First try to install FUDforum 2.7.6RC1 and 2nd make sure that mbstring function overload is disabled. Also see if your PHP was compiled with zend-multibyte support.


Dear Ilia,
I've tried installing Fudforum 2.7.6RC1 and came up with the same strange outcome. ????? on a blank screen.

My php is compiled with zend-multibyte support enabled, and is configured so that mbstring function overload is set to 0. Hopefully that means disabled. The ?????'s occur in both php5.1.2 and php5.1.4, but not with php4.4.2, which brings up a 5step wizard.
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33212 is a reply to message #33210] Thu, 17 August 2006 22:49 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
There is a bug in the zend engine, which causes the installer to fail because your PHP was compiled with zend-multibyte support. Try removing and try again.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33231 is a reply to message #33212] Sun, 20 August 2006 19:43 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi again.
Took a little bit to find a way to recompile php5 without zend-multibyte support. To make a long story short, I couldn't figure out how to do it with Xampp, but started from scratch....but now I have both versions (full and EGW) of Fudforum working. Razz

RE: imsg_edt.inc.t. Which function generates the send list, and which flag is the one that corresponds to "All message forum notification option"?

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33239 is a reply to message #33231] Mon, 21 August 2006 11:47 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
ky@smi wrote on Sun, 20 August 2006 21:43


RE: imsg_edt.inc.t. Which function generates the send list, and which flag is the one that corresponds to "All message forum notification option"?



Is the function I'm looking for the approve function?
Also, where can I find the definition of the u.users_opt structure?

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33241 is a reply to message #33239] Mon, 21 August 2006 13:43 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The description of the bit masks of users_opt is described inside fud_users.tbl which can be found inside sql/ directory. As far as the message notification thing, inside the approve() method look for the /* handle notifications */ comment, to do what you need you'll need to adjust the SQL queries in that block. Using imsg_edt.inc.t inside the stock forum for reference will probably help you out.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33248 is a reply to message #33241] Mon, 21 August 2006 15:41 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
Ok. I found the block, and will start playing with the SQL queries. Once I make changes, how do I link the changes to the forum code? Do I need to do a theme rebuild?
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33255 is a reply to message #33248] Tue, 22 August 2006 13:33 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Once you modify imsg_edt.inc.t you can push them "live" by rebuilding the theme.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33273 is a reply to message #33255] Wed, 23 August 2006 13:00 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
I think I'm slowly getting there. I'm struggling a bit with all the variables and registers... In any case, where can I find the definition of the global variable FUD_OPT_3. In EGW it is set to 0, while the full version it is set to some large number. I guess it is also a register for settings.
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33279 is a reply to message #33273] Wed, 23 August 2006 13:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The description of values in this bitmask can be found inside GLOBALS_HELP file inside the include directory.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33287 is a reply to message #33279] Wed, 23 August 2006 17:09 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
I've been going through the /*handle notifications */ code in approve() and comparing the EGW version with the fudforum2 version. As far as I can figure setting the "All Message Forum Notification" forces execution of the /*send new thread notifications to forum subscribers*/ for new threads and sets $notify_type to 'frm', so creating a new thread should notify all users of the forum. The problem I come to is that the EGW version only seems to send notifications to one user...whomever comes out first in the SQL query. I can't seem to get lists of users notified, even though all 4 users that I am testing with have different email addresses and are subscribed to the forum.

I'm also having problems seeing how the PHP and SQL execute... Embarassed . I'm pretty new to this stuff. So I put in a debug line that writes a file:
file_put_contents("to.txt",sprintf("notify_type: %s\nto: %s\n",$notify_type,$to['EMAIL']));

to see the list...and I get one address, when there should be 4 or 5...and only one user, the user with the email that comes up in the to.txt file gets notified. The notify type is ok..it shows "frm". I tried the same trick in the full version, and I get a list of users out. I had not modified the SQL code but only added the debug line and only created a new thread in the forum.

Any ideas?
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33302 is a reply to message #33287] Thu, 24 August 2006 15:22 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Have you checked how many records does the notification query returns and what is the contents of the $to['EMAIL'] array?

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33311 is a reply to message #33302] Fri, 25 August 2006 12:47 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Ilia wrote on Thu, 24 August 2006 17:22

Have you checked how many records does the notification query returns and what is the contents of the $to['EMAIL'] array?


I used a count($to['EMAIL']) and it shows 1 when there's 1 email address as the contents to $to['EMAIL'] and 0 if there's no email. I have not so far gotten it to have more than 1 email address in the array in the EGW version. In the full version, I have had lists of email addresses.

Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33315 is a reply to message #33311] Fri, 25 August 2006 14:51 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Can you show me the query being executed?

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33323 is a reply to message #33315] Sat, 26 August 2006 07:27 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Ilia wrote on Fri, 25 August 2006 16:51

Can you show me the query being executed?


How do I do this? Embarassed
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33328 is a reply to message #31787] Sat, 26 August 2006 22:47 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Again,
Please disregard the question about how to view queries. I got mysql query browser to work.

I've been going through the sql queries from the /* send new thread notifications to forum subscribers */

$c = uq('SELECT u.email, u.icq, u.users_opt
FROM phpgw_fud_forum_notify fn
INNER JOIN phpgw_fud_users u ON fn.user_id=u.id
LEFT JOIN phpgw_fud_forum_read r ON r.forum_id=fn.forum_id AND r.user_id=fn.user_id
INNER JOIN phpgw_fud_group_cache g1 ON g1.user_id=2147483647 AND g1.resource_id='.$mtf->forum_id.'
LEFT JOIN phpgw_fud_group_cache g2 ON g2.user_id=fn.user_id AND g2.resource_id='.$mtf->forum_id.'
WHERE
fn.forum_id='.$mtf->forum_id.' AND fn.user_id!='.(int)$mtf->poster_id.'
AND (CASE WHEN (r.last_view IS NULL AND (u.last_read=0 OR u.last_read >= '.$mtf->frm_last_post_date.')) OR r.last_view > '.$mtf->frm_last_post_date.' THEN 1 ELSE 0 END)=1
AND ((CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) & 2) > 0');

and found that excluding
AND (CASE WHEN (r.last_view IS NULL AND (u.last_read=0 OR u.last_read >= '.$mtf->frm_last_post_date.')) OR r.last_view > '.$mtf->frm_last_post_date.' THEN 1 ELSE 0 END)=1 AND ((CASE WHEN g2.id IS NOT NULL THEN g2.group_cache_opt ELSE g1.group_cache_opt END) & 2) > 0

gives me the correct list. The list goes wrong when

AND (CASE WHEN... ELSE 0 END)=1 is included.

The full version of Fudforum doesn't run this if smart notifications is disabled.

I don't understand the above. When someone posts a new topic, the r.last_view is never null because it immediately comes up in the next window that the poster sees.

Also, I don't understand
r.last_view > '.$mtf->frm_last_post_date.'
Can I interpret this as
if the last view of the thread is after the last post date in the forum, then TRUE?

Am I making an error in interpretation here?

RE:the 2nd half of the filter, what is the g2.group_cache supposed to do?
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33329 is a reply to message #31787] Sun, 27 August 2006 01:00 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
There seems to be another problem in the EGW code. Following the notifications queries, there is a while loop which is supposed to create the $to array.

while ($r = db_rowarr($c)) {
if ($r[2] & 16) {
$to['EMAIL'] = $r[0];
} else {
$to['ICQ'] = $r[1].'@pager.icq.com';
}
if (isset($r[4]) && is_null($r[3])) {
$tl[] = $r[4];
}
}

Unlike the full version which runs all of this in a subroutine, db_all() to generate the $to array, it doesn't seem to create a proper array. The email addresses from subsequent loops in the while overwrites the previous email address. So only the last email address remains in the $to variable, and the last person on the list gets notified. I'm not sure what is in $r[4]...but could I eliminate the ICQ notifications, and do something like (as in db_all())

$to=array();
while ($r = db_rowarr($c)) {
if ($r[2] & 16) {
$to[] = $r[0];
}
if (isset($r[4]) && is_null($r[3])) {
$tl[] = $r[4];
}
}

or is there a better solution...like create a $to_email array and a $to_icq array and do something like
$to['EMAIL']=$to_email;
$to['ICQ']=$to_icq;
or
$to['EMAIL'][].... or something like this? My guess is it won't be clean, and the send_notifications() will have to be modified too... Sad
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33341 is a reply to message #33329] Sun, 27 August 2006 16:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I think you need to change the code so that $to['EMAIL'] = $r[0]; is $to['EMAIL'][] = $r[0]; and then make sure that the send notifications functions can handle an array argument.

FUDforum Core Developer
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33386 is a reply to message #33341] Tue, 29 August 2006 14:49 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Ilia,
Got the notifier to notify lists of email Very Happy

I couldn't get $to['EMAIL'][] to work, but got the following to work.

$to_email=array();/*ADDED*/
$to_icq=array(); /*ADDED*/
while ($r = db_rowarr($c)) {
    if ($r[2] & 16) {
        $to_email[]= $r[0]; /*ADDED*/
//      $to_email['EMAIL']=$r[0];
    } else {
        $to_icq[] = $r[1].'@pager.icq.com'; /*ADDED*/
//      $to_email['ICQ']=$r[1].'@pager.icq.com'; 
    }
    if (isset($r[4]) && is_null($r[3])) {
        $tl[] = $r[4];
    }
}
$to['EMAIL']=$to_email; /*ADDED*/
$to['ICQ']=$to_icq; /*ADDED*/


Also found a problem in line 40 of iemail.inc.t (EGW version)

if (is_array($to)) {
//  $to = $to[0];
    $to_tmp=$to[0]; /* ADDED*/
    if (count($to) > 1) {
        unset($to[0]);
        $bcc = 'Bcc: ' . implode(', ', $to);
    }
    $to=$to_tmp; /* ADDED */
}

The $to variable was being written over before it the $bcc was written, so only one email notification was going out.
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33387 is a reply to message #33386] Tue, 29 August 2006 15:10 Go to previous messageGo to next message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
Hi Again,
My new problem is that I'm having problems with the headers going to mail(). If I include

mail($to, $subj, str_replace("\r", "", $body), "From: ".$from."\nErrors-To: ".$from."\nReturn-Path: ".$from."\nX-Mailer: FUDforum v".$GLOBALS['FORUM_VERSION'].$header.$bcc);

I cannot see the email because of an error in the header. If I strip the header to only the BCC,
mail($to, $subj, str_replace("\r", "", $body), $bcc);

then none of the MIME works, but I can read the email.
Re: How to include ALL of text in email notifications to those subscribed to a topic? [message #33390 is a reply to message #33387] Tue, 29 August 2006 17:50 Go to previous messageGo to previous message
ky@smi is currently offline  ky@smi   Denmark
Messages: 27
Registered: June 2006
Karma: 0
Junior Member
ky@smi wrote on Tue, 29 August 2006 17:10

Hi Again,
My new problem is that I'm having problems with the headers going to mail(). If I include

mail($to, $subj, str_replace("\r", "", $body), "From: ".$from."\nErrors-To: ".$from."\nReturn-Path: ".$from."\nX-Mailer: FUDforum v".$GLOBALS['FORUM_VERSION'].$header.$bcc);

I cannot see the email because of an error in the header. If I strip the header to only the BCC,
mail($to, $subj, str_replace("\r", "", $body), $bcc);

then none of the MIME works, but I can read the email.



I guess I should quantify the error I'm getting. My email client says "Empty or Malformed message". It seems to skip the plain text and html message and directly transfer encodes with BASE64.
Pages (2): [1  2    »]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Signature doesn't show up when i post through mail
Next Topic: Posting and reading by email
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 10:27:31 GMT 2024

Total time taken to generate the page: 0.02798 seconds