[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 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 - Custom Toolbar Macro

Custom Toolbar Macro

Scripting questions and ideas

Moderators: Eric, Tomas, robin, Michael

Custom Toolbar Macro

Postby Casey » Wed Nov 24, 2004 3:44 am

I'd like to create a custom toolbar button that creates a new message from a template.

I haven't seen a script listed that does this, but am wondering if anyone has a script that will do this for me?
Casey
Poco Tourist
 
Posts: 40
Joined: Fri Nov 19, 2004 5:33 pm

Postby MarkB » Wed Nov 24, 2004 11:29 pm

The New button has a drop-down menu for selecting among templates. If that won't suffice, you possibly could assign the following command to a button. Replace TEMPLATE_NAME with the template's name minus the .txt.

Code: Select all
/perform/newmessage/TEMPLATE_NAME/


PocoScript FAQ - Assigning a script to a button

Poco User Interface - Command Tags
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby Casey » Thu Nov 25, 2004 2:41 am

Thanks, Mark.

I have a single contact that I need to request a return receipt from on every email. I created a template which includes that option, but I keep forgetting to use it. I'm hopiing that a separate button next to "new" will remind me to do so.

I'd prefer a script of some type that was tied to that particular contact to automate the process, but that's beyond my capabilities.
Casey
Poco Tourist
 
Posts: 40
Joined: Fri Nov 19, 2004 5:33 pm

Postby Casey » Thu Nov 25, 2004 2:56 am

Actually, I just tested my template and it doesn't remember to engage the RR feature, so the whole point appears to me moot.
Casey
Poco Tourist
 
Posts: 40
Joined: Fri Nov 19, 2004 5:33 pm

Postby MarkB » Thu Nov 25, 2004 3:00 am

As for the botton... You can certainly add a button to Poco's toolbar (as described in the links).

Click Tools | Scripts | Buttons.
Insert the code I gave you above in an available space in the left column.
Click Close.

Then right-click in a blank space in Poco's main toolbar and select "Customize Toolbar." Add the appropriate User Action # to the toolbar; the number is the button number from the preceding step.
MarkB
Poco Enthusiast
 
Posts: 217
Joined: Mon Aug 09, 2004 1:31 am
Location: Canada

Postby Michael » Thu Nov 25, 2004 3:26 am

To add return receipt headers, try the following script (and configure it's execution based on filter criteria either in events or in the Outgoing message).
Code: Select all
{ Filename       : AddReturnReciptHeader.poc
{ Version        : 1.0.0.1
{ Date           : 15Oct2002
{ Status         : Release
{ Solution      : Turn on the "Return receipt" header as the default.
{ Language      : PocoScript
{ Platform      : x86
{ Target O/S's  : Win
{ Dependencies  : PocoMail v2.63
{ Modes         : This script can only be run against outgoing messages
{                 or via one of the following Poco events:
{                 - OnCompose, onBounceEdit, onForwardAttEdit, OnForwardEdit,
{                   OnReplyAllEdit, OnReplyEdit
{               : Running the script on outgoing events will cause the header to be added
{                  to all messages. You can control this to a degree by
{                  by configuring filters to decide when to run the script.
{               : See www.jdfsoftware.com/pocofaq/events.html for how to setup the events.
{ Author        : Michael Motek
{ Company       : Juan de Fuca Software
{ Company website: www.jdfsoftware.com
{ Restriction   : Will not change the receipt delivery address if the account is changed.

{  Add a Return-Receipt-To: header to outgoing messages.

{ Modifications:
{  16Oct2002 - M.Motek - Allow script to be run against outgoing messages.

If #PocoScriptMode = 2 Then AddHdr
If #PocoScriptMode < 100 Then WrongMode

:AddHdr
   ReadEMail $id
   AddHeader %message "Disposition-Notification-To:" $id
Exit

:WrongMode
   AddStrings $Msg "The " $PocoScriptName " script is only designed to be run on outgoing messages or used with Poco's event triggers."
   MessageBox $Msg


Note: Watch for line wrapping, the AddStrings command following the ":WrongMode" label ends with the text triggers.". All this must be on a single line.
Michael
Moderator
 
Posts: 866
Joined: Mon Jul 26, 2004 12:14 pm
Location: Victoria BC, Canada

Postby Casey » Thu Nov 25, 2004 8:16 am

Thanks, Michael

That's just the ticket! Appears to work just fine.
Casey
Poco Tourist
 
Posts: 40
Joined: Fri Nov 19, 2004 5:33 pm


Return to PocoScript Help and How-To

Who is online

Users browsing this forum: No registered users and 0 guests

cron