Email Forwarding Question

9 posts by 2 authors in: Forums > CMS Builder
Last Post: September 19, 2014   (RSS)

By claire - September 9, 2014

Hi Jerry

I think you need a string compare here. Have you tried something like this?

$allAccounts  =  mysql_query_fetch_all_assoc("SELECT * FROM `{$TABLE_PREFIX}accounts` WHERE board_of_director_position_1 LIKE '%Treasurer%' ");

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Thanks Claire,

I'll give that a try tomorrow

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Thanks Claire,

Sorry for the delay.

That worked.

I found that since I was pulling the "Treasurer" value from another table, I needed to put the record number into the string compare.

So,

$allAccounts  =  mysql_query_fetch_all_assoc("SELECT * FROM `{$TABLE_PREFIX}accounts` WHERE board_of_director_position_1 LIKE '%4%' ");

returned the correct array values.

Is there an easy way to reference the "Treasurer" label Value instead?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Hi Jerry

If you're storing a reference to a record in another table by record number, then you're really stuck with using that record number in the query. Changing things around to get a reference to the label instead isn't really all that easy here.

Make sure you change it to a plain integer comparison, seeing as you're not checking against a string here:

$allAccounts  =  mysql_query_fetch_all_assoc("SELECT * FROM `{$TABLE_PREFIX}accounts` WHERE board_of_director_position_1 = 4");

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By gkornbluth - September 12, 2014 - edited: September 12, 2014

Great advice...

Now I guess that I'll have to tackle the forwarding part of the question.

Any ideas where too start?

The email download plugin perhaps?

Thanks,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Depends on how you want to forward the emails.

You could set up an email template, use the email address list as a placeholder in the BCC field, and send it out that way?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By gkornbluth - September 18, 2014 - edited: September 18, 2014

Hi Claire,

I'd like to set this up as simply as possible, very similar to email forwarding on a mail server.

All mail sent to a@mydomain.com (the domain that has an CMSB installation) gets forwarded to b@gmail.com and c@hotmail.com, and f@aol.com with no alterations.

All mail sent to b@mydiomain.com gets forwarded to d@aol.com and someone@gmail.com.

Etc,

I'm trying to make it easier for site managers to keep up with changing forwarding assignments from within CMSB instead of having to log into a mailserver.

Thanks

Jerry

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

I'd say you'd want to use php-imap to get the emails, then use the native PHP mail function to resend them out to the different addresses set in CMSB.

https://code.google.com/p/php-imap/

Not sure if it's ideal, but it might be a good place to start.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/