DS
|
Posted: 01/12/2004, 9:22 PM |
|
Using CCS 222.40
I want to add a facilty to sign up for a monthly newsletter and then send
the newsletter to all who have signed up, doubtful it will be more than
200-300 trade enquirers.
I have no problem getting the details into MySql, but I'm a bit stuck on how
to set up the page in CCS to compose the newsletter and send it to all the
registrants.
Any help would be appreciated.
Denis
|
|
|
TAiNT
Posts:
|
Posted: 01/13/2004, 3:30 AM |
|
It's easy. Take a look:
If you won't store newsletter in the database you may use this method
1. Create plain Record form (name it Newsletter for example) with all fields you need.
2. You can freely delete Update and Delete buttons that created by CCS, because your form will be always in the Insert mode.
2. Use Add button's OnClick (Server side one) event for sending e-mails.
I strongly recommend you not just roll over array of your subscribers and sent separate e-mails to each one but create list of recipients and after it supply it to Bcc: field. This function will be handy Put it to the Common.php
function SendMails($recipients, $subject, $body, $from="Some.default.email.com") {
$email_to = " ";
$headers .= "From: ".$from."\n";
$headers .= "Bcc: ".$recipients."\n";
$headers .= "X-Priority: 3\nX-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: DS Newsletter posting facility\n";
if ( !@mail($email_to, $subject, $body, $headers) ) die("ERROR! SendMails(): Could not send the email. Failed at 'mail' command.");
}
$recipients should contain list of e-mails separated by comma.
after it in OnClick event :
// -----
// prepare list of recipients somehow
// .....
//
SendMails($recipients, $Newsletter->Subject->GetValue(), $Newsletter->Body->GetValue());
// -----
This will send newsletters in plain text format. Smoke the PHP manual to find out how send HTML e-mails
If you want store newsletters sent by you in the DB than use Before or After Insert events instead of OnClick one.
That's it. Hope, it's helps.
|
|
|
DS
|
Posted: 01/13/2004, 9:33 PM |
|
Thanks Taint, I'll give it a go.
Denis
"TAiNT" <TAiNT@forum.codecharge> wrote in message
news:54003d6ecb1c41@news.codecharge.com...
> It's easy. Take a look:
>
> If you won't store newsletter in the database you may use this method
> 1. Create plain Record form (name it Newsletter for example) with all
fields you need.
> 2. You can freely delete Update and Delete buttons that created by CCS,
because your form will be always in the Insert mode.
> 2. Use Add button's OnClick (Server side one) event for sending e-mails.
>
> I strongly recommend you not just roll over array of your subscribers and
sent separate e-mails to each one but create list of recipients and after it
supply it to Bcc: field. This function will be handy Put it to the
Common.php
>
> function SendMails($recipients, $subject, $body,
$from="Some.default.email.com") {
> $email_to = " ";
> $headers .= "From: ".$from."\n";
> $headers .= "Bcc: ".$recipients."\n";
> $headers .= "X-Priority: 3\nX-MSMail-Priority: Normal\n";
> $headers .= "X-Mailer: DS Newsletter posting facility\n";
> if ( !@mail($email_to, $subject, $body, $headers) ) die("ERROR!
SendMails(): Could not send the email. Failed at 'mail' command.");
> }
>
> $recipients should contain list of e-mails separated by comma.
>
> after it in OnClick event :
>
> // -----
> // prepare list of recipients somehow
> // .....
> //
>
> SendMails($recipients, $Newsletter->Subject->GetValue(),
$Newsletter->Body->GetValue());
>
> // -----
>
> This will send newsletters in plain text format. Smoke the PHP manual to
find out how send HTML e-mails
>
> If you want store newsletters sent by you in the DB than use Before or
After Insert events instead of OnClick one.
>
> That's it. Hope, it's helps.
> _________________
> Take care...
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
bouvet
Posts: 24
|
Posted: 06/02/2004, 7:44 AM |
|
Hello,
I read in the forum your question about the newsletter. How do you solve the problem. I would send a newsletter to subscribers who are in my database.
Thanks Philippe
Using CCS 222.40
I want to add a facilty to sign up for a monthly newsletter and then send
the newsletter to all who have signed up, doubtful it will be more than
200-300 trade enquirers.
I have no problem getting the details into MySql, but I'm a bit stuck on how
to set up the page in CCS to compose the newsletter and send it to all the
registrants.
Any help would be appreciated.
Denis
_________________
Webdesign Hildesheim Hannover
http://www.actidesign.com |
|
|
|