Page 1 of 1
email notification after profile submit
Posted: Mon Mar 19, 2007 3:08 pm
by dbuch
I may be missing something, but is there a way to send a thank you to a new contact and notify an administrator that a new contact has been submitted. I think donate does this. I saw a post form last year about this.
http://forum.joomla.org/index.php/topic,94155.0.html
I am hoping this has been built in since then but if it is there i don't see it.
Thank you,
David Buchmueller
Re: email notification after profile submit
Posted: Tue Mar 20, 2007 2:17 am
by lobo
the solution is there on that forum post. Follow the instructions and u should be all set
Re: email notification after profile submit
Posted: Thu Mar 22, 2007 4:09 pm
by dbuch
Hi Lobo,
I added the code below at the end of the file. Settings updated. Tried a few different smtp host settings including smtp authorization.
Added code only to civicrm.php. Any suggestions? And can you recommend someone for minor customizations?
Thank you,
David
------------------------------------------------------------------------------------------------------------
Error generated:
------------------------------------------------------------------------------------------------------------
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
Code: Select all
=>
[message] => Invalid response code received from server
[mode] => 16
[debug_info] =>
[type] => pear_error
[user_info] =>
[to_string] => [pear_error: message="Invalid response code received from server" code=0 mode=callback callback=CRM_Core_Error::handle prefix="" info=""]
)
------------------------------------------------------------------------------------------------------------
code added to civicrm.php
------------------------------------------------------------------------------------------------------------
function joomla_civicrm_post( $op, $objectName, $objectId, &$objectRef ) {
// only interested in the profile object and create operation for now
if ( $objectName != 'Profile' || ( $op != 'create' && $op != 'edit' ) ) {
return;
}
require_once 'CRM/Utils/Mail.php';
$fromName = 'My Org Administrator';
$fromEmail = 'my@my.org';
$from = CRM_Utils_Mail::encodeAddressHeader( $fromName, $fromEmail );
$toEmail = $objectRef['email-1'];
$toName = "{$objectRef['first_name']} {$objectRef['last_name']}";
$params = print_r( $objectRef, true );
$subject = "Thank you for supporting My Org";
$message = "
Dear $toName:
Thank you for your show of support. The details u signed up with are:
$params
Regards
My Org Team
";
$cc = 'cc@my.org';
CRM_Utils_Mail::send( $from,
$toName,
$toEmail,
$subject,
$message,
$cc );
}
Re: email notification after profile submit
Posted: Thu Mar 22, 2007 6:48 pm
by lobo
can u change the email address
my@my.org to an email addres recognized by your server and/or from your domain
check:
http://civicrm.org/professional/, you might want to try web access. they are quite reasonable and know a fair bit of joomla
lobo