How to use the new email plugin
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
EJ Jaquet <ejjaq... @gmail.com>
Date: Sun, 8 Nov 2009 08:11:11 -0800 (PST)
Local: Sun, Nov 8 2009 11:11 am
Subject: How to use the new email plugin
Hi all,
I am looking into the new email plugin, which sounds very usefull.
I am very interested in how to send an email with tokens with the
plugin but I can not find any documentation yet.
Anyone used this plugin, and wants to share how they have done it?
Kind regards,
Erik-Jan Jaquet
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Dorioo <dor... @gmail.com>
Date: Mon, 9 Nov 2009 11:51:29 -0500
Local: Mon, Nov 9 2009 11:51 am
Subject: Re: [coldbox:3494] How to use the new email plugin
Are you using 3.0? If you are, you could inject the plugin where needed and
do something like below. I'm referencing it as "instance.mailSevice" because
I'm injecting it but the same can be done using getPlugin() where
applicable.
1. Get a new mail object
<cfset var emailObject = instance.mailservice.newMail()>
2. Configure the object's properties. You can use the config function or
setters. CFDUMP to easily see all the setters or look at
coldbox/system/beans/Mail.cfc
<cfset emailObject.config(from = whatever1
,username = whatever2
...)>
3. Send the email
<cfset instance.mailservice.send(emailObject)>
PS. "coldbox/system/beans/Mail.cfc" may have type="int" references that
don't work in CF8 or CF9. Change those to type="numeric" to get it working
for now.
- Gabriel
On Sun, Nov 8, 2009 at 11:11 AM, EJ Jaquet <ejjaq
... @gmail.com> wrote:
> Hi all,
> I am looking into the new email plugin, which sounds very usefull.
> I am very interested in how to send an email with tokens with the
> plugin but I can not find any documentation yet.
> Anyone used this plugin, and wants to share how they have done it?
> Kind regards,
> Erik-Jan Jaquet
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Luis Majano <lmaj... @gmail.com>
Date: Mon, 9 Nov 2009 08:45:00 -0800
Subject: Re: [coldbox:3494] How to use the new email plugin
Erik,
It is very simple, you can read the API to understand it. Here is a simple
breakdown until the docs are complete:
1. get a new mail object: getPlugin("MailService").newMail();
Populate it with your mail information and then you can also set a structure
of name-value pairs as tokens:
tokens = {name="Luis Majano",time=dateformat(now(),"full")};
mail.setBodyTokens(tokens);
Once the tokens are set,the mail service will try to match them in the body
of a message and replace them. So I can do this:
mail.setBody("Hello @name@, how are you today? Today is the @time@");
As you can see, tokens are in the format of @token-name@, then the service
will replace them for you. Then just send them using the send() method.
Luis F. Majano
President
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com
On Sun, Nov 8, 2009 at 8:11 AM, EJ Jaquet <ejjaq
... @gmail.com> wrote:
> Hi all,
> I am looking into the new email plugin, which sounds very usefull.
> I am very interested in how to send an email with tokens with the
> plugin but I can not find any documentation yet.
> Anyone used this plugin, and wants to share how they have done it?
> Kind regards,
> Erik-Jan Jaquet
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Erik-Jan Jaquet <ejjaq... @gmail.com>
Date: Tue, 10 Nov 2009 09:44:40 +0100
Local: Tues, Nov 10 2009 3:44 am
Subject: Re: [coldbox:3496] Re: How to use the new email plugin
Hi Luis, Gabriel,
Thanks for your input! It is working great now! The new Coldbox 3.0 looks
promising!
Kind regards,
Erik-Jan
2009/11/9 Luis Majano <lmaj... @gmail.com>
> Erik,
> It is very simple, you can read the API to understand it. Here is a simple
> breakdown until the docs are complete:
> 1. get a new mail object: getPlugin("MailService").newMail();
> Populate it with your mail information and then you can also set a
> structure of name-value pairs as tokens:
> tokens = {name="Luis Majano",time=dateformat(now(),"full")};
> mail.setBodyTokens(tokens);
> Once the tokens are set,the mail service will try to match them in the
> body of a message and replace them. So I can do this:
> mail.setBody("Hello @name@, how are you today? Today is the @time@");
> As you can see, tokens are in the format of @token-name@, then the service
> will replace them for you. Then just send them using the send() method.
> Luis F. Majano
> President
> Ortus Solutions, Corp
> ColdBox Platform: http://www.coldbox.org
> Linked In: http://www.linkedin.com/pub/3/731/483
> Blog: http://www.luismajano.com
> IECFUG Manager: http://www.iecfug.com
> On Sun, Nov 8, 2009 at 8:11 AM, EJ Jaquet <ejjaq... @gmail.com> wrote:
>> Hi all,
>> I am looking into the new email plugin, which sounds very usefull.
>> I am very interested in how to send an email with tokens with the
>> plugin but I can not find any documentation yet.
>> Anyone used this plugin, and wants to share how they have done it?
>> Kind regards,
>> Erik-Jan Jaquet
You must
Sign in before you can post messages.
You do not have the permission required to post.