mail to admin by new posts

Phoca Guestbook - creating guestbooks in Joomla! CMS
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: mail to admin by new posts

Post by Jan »

Hi, see:

components/com_phocaguestbook\site\models\guestbook.php line 121:

- if the parameter send_super_email is set to yes (some user selected) - the email will be sent to the user which was selected in Global Configuration of Phoca Guestbook
- if the parameter send_email is set to yes (some user selected) - then the email will be sent to the user which was selected in Menu link parameters of the menu link to guestbook

Then see:


components/com_phocaguestbook\helpers\phocaguestbookemail.php

The email is sent from the user who add the email address - if the email is set, it is set by the user email address, if not, then it is sent by the user selected in menu link parameters or user selected in global configuration.


So user abc [at] mail_services [dot] com add a post, then it is sent by this email (the email is sent by your server but with this name) if not, then by user selected in parameters.

If you have problems or limits on your server, that e.g. the email address must be some specific, you can customize the line cca 44:

FROM:

Code: Select all

if (isset($post2['email']) && $post2['email'] != '') {
			$mailfrom = $post2['email'];
		} else {
			$mailfrom = $rows[0]->email;
		}
TO:

Code: Select all

$mailfrom = $rows[0]->email;
// or $mailfrom = 'your specific email address';
Jan
If you find Phoca extensions useful, please support the project
DZrenner
Phoca Member
Phoca Member
Posts: 21
Joined: 16 May 2013, 15:01

Re: mail to admin by new posts

Post by DZrenner »

Jan wrote: ...Then see:


components/com_phocaguestbook\helpers\phocaguestbookemail.php
...
If you have problems or limits on your server, that e.g. the email address must be some specific, you can customize the line cca 44:

FROM:

Code: Select all

if (isset($post2['email']) && $post2['email'] != '') {
			$mailfrom = $post2['email'];
		} else {
			$mailfrom = $rows[0]->email;
		}
TO:

Code: Select all

$mailfrom = $rows[0]->email;
// or $mailfrom = 'your specific email address';
Jan
Yes that did it!

Thank you very much for your help.

Best regards
Dieter
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49138
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Solved] mail to admin by new posts

Post by Jan »

Ok, great to hear it.

Jan
If you find Phoca extensions useful, please support the project
Post Reply