email notification after profile submit

Discuss and receive support for the integration of CiviCRM and Joomla!
Locked
dbuch
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Fri Sep 16, 2005 2:48 pm

email notification after profile submit

Post by dbuch » Mon Mar 19, 2007 3:08 pm

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

lobo
Joomla! Guru
Joomla! Guru
Posts: 502
Joined: Tue Aug 23, 2005 5:45 am

Re: email notification after profile submit

Post by lobo » Tue Mar 20, 2007 2:17 am

the solution is there on that forum post. Follow the instructions and u should be all set

dbuch
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Fri Sep 16, 2005 2:48 pm

Re: email notification after profile submit

Post by dbuch » Thu Mar 22, 2007 4:09 pm

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 = '[email protected]'; 
    $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       = '[email protected]'; 
 
    CRM_Utils_Mail::send( $from, 
                          $toName, 
                          $toEmail, 
                          $subject, 
                          $message, 
                          $cc ); 
     
} 


lobo
Joomla! Guru
Joomla! Guru
Posts: 502
Joined: Tue Aug 23, 2005 5:45 am

Re: email notification after profile submit

Post by lobo » Thu Mar 22, 2007 6:48 pm

can u change the email address [email protected] 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


Locked

Return to “CiviCRM Support”