Use Contact's Email2

Get help from the community here.

Moderator: Developers

Use Contact's Email2

Postby hchefitz » Sun Oct 16, 2011 4:12 pm

Is there I hack to the code I can do to have BOTH email and email2 of contacts added to an addresslist?

My contacts are students in a school, and most parents provide two emails for school communication (mother's and father's). I'd like to have one contact entry for each student to correspond to our registration database table. Hopefully, it's as easy as adding "email2" to a few files, something I'd be able to edit myself. This way, when I send pout an email to a class address list, it will go to both parents.

Thanks,

Harry
hchefitz
 
Posts: 5
Joined: Mon Jul 11, 2011 6:34 pm

Re: Use Contact's Email2

Postby WilmarVB » Mon Oct 17, 2011 1:08 pm

A quick way is by adding just a few lines in the source code. You'll want to add the contact's second email field in the query in function get_contacts_for_send($mailing_id) of mailings.class.inc.php and use that field in a second call to send() around line 142 in sendmail.php .

Needless to say, this modification will have to be re-modified after every GO upgrade.
Kind regards,
WilmarVB
Intermesh
User avatar
WilmarVB
Group-Office Developer
 
Posts: 86
Joined: Mon May 10, 2010 3:47 pm
Location: Den Bosch, Netherlands

Re: Use Contact's Email2

Postby hchefitz » Tue Oct 18, 2011 1:34 am

Thanks.

I thought of another workaround that doesn't touch the source code: I updated the ab_contacts database to make email a CONCAT_WS of email2 (mother's email) and email3 (father's email) with a ";" between. I need to automate this in a script.
hchefitz
 
Posts: 5
Joined: Mon Jul 11, 2011 6:34 pm

Re: Use Contact's Email2

Postby WilmarVB » Tue Oct 18, 2011 1:14 pm

Hello HChefitz,

I understand why you think about concatenating db fields, but there is no event or hook that fires at the collection of mailing email addresses or sending of mailing emails to hook your script on. If you want to change the mail sending behavior, you have to do it at the places I just mentioned.

Is it a solution for you to add a contact for the second parents?
Kind regards,
WilmarVB
Intermesh
User avatar
WilmarVB
Group-Office Developer
 
Posts: 86
Joined: Mon May 10, 2010 3:47 pm
Location: Den Bosch, Netherlands


Return to General help

Who is online

Users browsing this forum: Google [Bot] and 0 guests

cron