Send Emails to ALL members upon record update

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
kavlito
Posts: 7
Joined: 2014-01-17 17:02

Send Emails to ALL members upon record update

Post by kavlito » 2014-01-17 17:25

I need to send an email to all members when a record is updated, added or deleted. I've seen 2 iterations on here that don't address sending to all members with the exception of hardcoding a csv list (which does not utilize BCC) . The goal is as follows:

1 - Send a notification email to all members when a record is updated, added or deleted
2 - The email cannot let members see a list of other members. Either need to loop through each member and send, or using BCC with csv.
3 - The email should show the record data

Any help would be greatly appreciated.

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Send Emails to ALL members upon record update

Post by shasta59 » 2014-01-22 01:31

Kavlito

That is not hard to do using hooks. As I am just back on my feet I have so much else to do but, if I have time, will send a solution. Can actually visualize how to do it but need to put fingers to keyboard.

Also, do you want to send to everyone who has an account or only those in certain groups? The issue with sending too many emails all at one time could be a problem. Some providers do not allow one account to send out over a certain number at a time. You may want to check that out with your provider. Sending the record data is easy. Do you want the record data to be pretty looking or just basic formatting?

A good place to start is here:

http://www.bigprof.com/appgini/help/adv ... ter_insert

Also how familiar are you with php etc.? Expert (eat sleep dream mysql/php), Advanced (just dream mysql/php), Beginner (can slog through it), Newbie (knows one is a coding language and one is a database).

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

kavlito
Posts: 7
Joined: 2014-01-17 17:02

Re: Send Emails to ALL members upon record update

Post by kavlito » 2014-01-22 20:06

Hi. Thanks for the reply.

I'm between a newbie & beginner. I've already checked out that link regarding the hooks and mod'd my app to send emails to a csv list. That's when I realized I do not want all recipients to see each other. Also, I don't want to maintain a csv list when the database already maintains the email addresses.
In my case, I need to send to all members. We're not using groups. Basically, we manufacture custom photo products and need to maintain a products specifications database where all members are notified upon additions, changes or deletions.

As far as sending emails, we will not be sending but maybe 4 times per month to between 30-50 members.

And as far as the record data looking pretty or basic, it doesn't really matter. The basic format generated in the testing I did was fine.

Here's the code I used (which is not BCC):

Code: Select all

function Products_after_update($data, $memberInfo, &$args){
// we need to iterate through the $data array
	foreach($data as $field => $value){
		$messageData .= "$field: $value \n";
	}

	@mail(
		// mail recipient
		"To: emailaddress, emailaddress2, emailaddress3",
		
		// subject
		"Product Update Notification",
		
		// message
		"The following record was updated by {$memberInfo['username']}: \n\n".
		$messageData."Click here to login http://weblink",
		
		// sender address
		"From: emailaddress"
		
	);
		return TRUE;
	}
I really appreciate your response, and any insight you have.

Thanks again.

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Send Emails to ALL members upon record update

Post by shasta59 » 2014-01-24 03:56

I will put up more info tomorrow if I can. At a client for 12 hours doing server stuff but may have some time to do it. One of my sites sends email out to about 40 members each time a record is updated and they do not know who else got it. I will put up that code after I make it generic so it can be used by you.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

kavlito
Posts: 7
Joined: 2014-01-17 17:02

Re: Send Emails to ALL members upon record update

Post by kavlito » 2014-01-29 16:50

Great. Looking forward to it. Thanks again.

phpnoob
Posts: 1
Joined: 2014-02-14 18:46

Re: Send Emails to ALL members upon record update

Post by phpnoob » 2014-02-14 19:03

Hi, I recently purchased AppGini on blind faith being told I could auto email upon record changes. I got it all set up only to find that's not entirely true. It needs modifications and even then, you have to maintain a csv list of email addresses that are redundantly already in the database. And, all email recipients can see each other! Yikes! I'd be fired for that.

If this has been resolved, I'd REALLY, REALLY, REALLY appreciate the post.

Thanks in advance.

Post Reply