[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Poco Forums • View topic - customing "to" field

customing "to" field

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

customing "to" field

Postby ghardenb » Fri May 15, 2009 12:20 am

When composing a reply I want to append a string such as ".readnotify.com" to the address in the "To" field.

I assume this will first require that the "to" field be trimmed down to display only the unbracketed (no "< >") email address (someone@somewhere.com) without the contact's display name. How?

Then there is the question of which tool to use in making this happen, an event procedure or an outgoing filter calling a script or what?
ghardenb
Poco Tourist
 
Posts: 38
Joined: Mon Nov 29, 2004 8:20 am
Location: Massachusetts

Postby MarkB » Sun May 17, 2009 1:31 am

Hi. Would you please give this little test script a whirl, to check whether I understand you. Add the script to your scripts folder. Then create an event of type OnReplyEdit, and have the event trigger this script. Then test.

ReadTo returns a list of addresses only, stripped of names -- and evidently a CRLF, which GetLine removes.

Code: Select all
{  DoOnReplyEdit
ReadTo $header %message
GetLine $t 0 $header
AddStrings $t ".readnotify.com"
ClearTo %message
AddTo %message $t
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ghardenb » Sun May 17, 2009 1:43 am

absolutely perfect! Thank you.
ghardenb
Poco Tourist
 
Posts: 38
Joined: Mon Nov 29, 2004 8:20 am
Location: Massachusetts

Postby MarkB » Sun May 17, 2009 2:44 am

We can leave it there then. If you want this to work with Reply All, too, that would require an additional event and script. To preserve names along with addresses would require actual effort ;).
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby ghardenb » Sun May 17, 2009 3:34 am

No, this is exactly what I needed. I use it only in one folder and only individually. Thanks.
ghardenb
Poco Tourist
 
Posts: 38
Joined: Mon Nov 29, 2004 8:20 am
Location: Massachusetts


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 2 guests

cron