HOWTO: Add and retrieve email addresses in a module thru code

by C.R. Matín on March 8, 2011

I came across this excellent post from the forums, where poster BlackMumba detailed how to add and retrieve the associated email records for a record. Inspired by the post,  I’ve brought his solution here and expanded upon it to show other use cases. Here’s how you can do it.

To add a new email address, you can do the following:

If you want to retrieve the primary email address for a record, you can do this:

And to grab all the email addresses for a record, use this code:

No hay relacionados:

{ 1 comment… read it below or add one }

Anre July 28, 2011 at 1:27 pm

Using $sea->addAddress($primaryemailaddress, true);
seems to remove all the non primary addresses?

Leave a Comment

Previous post:

Next post: