Changing email notification address

Permalink Browser Info Environment
Guys,

Have installed this block and handed over to the customer but when somebody enters his email to subscribe I get the notification. I suspect this because I am super user.

How do I change this please? There seems no obvious route unlike a form where it is easy!

Ia

Type: Discussion
Status: New
igrieves
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
Hi Ian,
Unfortunately this block will only send emails to the site administrator, and there is no setting to change it (it is admittedly quite limited in functionality).

If you don't mind a little hackery, you can try modifying the code of this addon. Create a new folder on your site at /blocks/email_list_signup/, and copy the /packages/email_list_signup/blocks/email_list_signup/controller.php file into that new folder. Then edit that new copied file and find this chunk of code:
private function getAdminEmail() {
   $adminUserInfo=UserInfo::getByID(USER_SUPER_ID);
   $adminEmail = $adminUserInfo->getUserEmail();
   return $adminEmail;
}

(should be around line 139 or so)

and replace it with this:
private function getAdminEmail() {
   return 'myemail@domain.com'; //<--set this to your actual email address
}

If you're okay hard-coding in an email address like this, having all emails go to the same person, and not being able to change it from the website admin, then this solution will work well. If, however, you require more advanced configuration options, you might want to try the paid "Mailing List" addon --http://www.concrete5.org/marketplace/addons/mailing-list/...

Regards,
Jordan
cheinen replied on at Permalink Reply
cheinen
Great, just the code I was looking for. Thanks for posting Jordan. It appears to be partially working for me though. The email address I specified in getAdminEmail() is now getting emails titled "[SiteName] New Email List Signup Pending". However, my admin email still gets the confirmation emails titled "[SiteName] New Email List Signup Confirmed". Weird.

Any ideas how to redirect the confirmation emails too?
jordanlev replied on at Permalink Reply
jordanlev
Ahh yes, I always forget about that one -- sorry.

There's a different file you have to change for the confirmation email:
YOURSITE/packages/email_list_signup/controllers/confirm_signup.php

Change this (should be around line #37):
$mh->to($adminEmail);

to this:
$mh->to('myaddress@domain.com');

(make sure you have those quotes in there surrounding your email address)

Let me know if you run into problems with that.

-Jordan
cheinen replied on at Permalink Reply
cheinen
Thanks Jordan!
laundry replied on at Permalink Reply
laundry
Hi Jordan!

Thanks for the codes! Worked well! <3
hydraimg replied on at Permalink Reply
hydraimg
I know this is some time afterwards, but I solved this by adding my client as an admin in the dashboard. I still get the email too but the client also receive them.
apc123 replied on at Permalink Reply
apc123
Hi Jordan,

Anyway I can yank the first email notification? I don't need to be informed when someone signs up before they confirm their address.

Cheers,
Anthony
jordanlev replied on at Permalink Reply
jordanlev
Yes,
Edit this file:
YOURSITE/packages/email_list_signup/blocks/email_list_signup/controller.php

and change this (should be around line #120):
@$mh2->sendMail();

to this:
//@$mh2->sendMail();

(if you're familiar with php at all you'll see that all we're doing is adding two slashes to the beginning of that line to "comment it out" so that it won't run)

Let me know if you have any problems with this.

-Jordan
apc123 replied on at Permalink Reply
apc123
perfect.
thanks

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.