Forums

subscribe/unsubscribe newsletter - trigger 2 seperate emails

vj@vjaus.com 08 Oct, 2011
Hi,

I have looked around the forum but cannot find an answer. Can someone please help or suggest to me.

I have a form which will have a subscribe and unsubscribe checkbox for newsletter.

I need to trigger 2 seperate emails based on what the user selects.

If the user selects subscribe - i need to send them email1 and if user selects unticks for subscription i need to send them another email.

Can someone please help me how to tackle this issue.

Regards
VJ
GreyHead 08 Oct, 2011
Hi VJ,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6.

Bob
vj@vjaus.com 09 Oct, 2011
Hi,

Thanks for your email. I am using: 4.0 RC1.9

I am using joomla 1.6

Can you please help me out.

Regards
VJ
GreyHead 09 Oct, 2011
Hi VJ,

You can do this a few ways - which is best will depend on your form.

a) You can edit the Email Template (without the Rich Text editor) and add PHP to make the text conditional:
<?php
if ( $form->data['subscribe'] == 'Yes' ) {
?>
. . . message for subscribers
<?php
} else {
?>
. . . message for non subscribers
<?php
}
?>

b) You could use a Custom Code element to build different messages save them into say $form->data['message'] and just echo that in the Email template.
c) You could use my custom Email [GH] action which includes a conditional test and set up several different emails with different conditions. This may be the neater solution if the addresses are different.

Bob
vj@vjaus.com 10 Oct, 2011
Hi Bob,

First of all thank you so much for your quick reply. I have used the Email action and it works. However i have one question. The form triggers an email to subscribers (people who tick on newsletter option) with the action {subscription}::1.

I would like to trigger one more email when people untick the box for newsletter. What will be the condition for this one. I have tried: {subscription}::0, This does not work.

Can you please suggest something. If i can fix this, it will solve the whole problem.

Regards
VJ
GreyHead 10 Oct, 2011
Hi VJ,

The problem is that an un-checked check-box doesn't return anything so that there is no value to find for {subscription}.

In ChronoFormc v4 RC2.0 Max introduced the idea of a 'ghost' value. If you open the Checkbox element configuration dialogue you'll see a 'Ghost' tab, click it and set a Ghost Value of say x Then you should be able to use {subscription}::x in the condition.

Bob

PS I chose not to set the ghost value to 0 as that may not be reliably carried through.
vj@vjaus.com 10 Oct, 2011
Hi Bob,

I am using version RC1.9. Do you have any work around for that.

Regards
VJ
GreyHead 10 Oct, 2011
Hi VJ,

Upgrade to RC2.0 :-)

Bob
vj@vjaus.com 10 Oct, 2011
:D Thanks Bob. You have been great.

Cheers
VJ
swd 11 Oct, 2011
Hi VJ,

You can just install the version 2.0 across the existing 1.9 using the normal Joomla installer - at leas that's what worked for me🙂

cheerio
Michael
GreyHead 12 Oct, 2011
Hi VJ,

Exactly as Michael says. Just install RC 2.0 over the existing installation; though it's always good practice to back up your forms and data before any upgrade.

Bob
This topic is locked and no more replies can be posted.