Event sign up functionality
Posted: 24 July 2007 08:30 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  01-23-2006

Hi,

I need to set up funtionality that allows a user to sign up for a program by submitting their email address and some other basic information.  I will probably use the SAEF for this but my problem is that I need the user to receive an email confirmation that they have signed up.  I know that EE allows an administrator to receive an email when a blog entry is made but is there a native way for a user to receive an email or will this require some PHP programming.  Wondering if anyone has done this before or if there is a better way to do this than with the SAEF.

Thanks in advance

Profile
 
 
Posted: 24 July 2007 08:51 AM   [ Ignore ]   [ # 1 ]  
Sr. Research Associate
Avatar
RankRankRankRankRank
Total Posts:  2936
Joined  12-06-2002

Look into SolSpaces FreeForm module - which allows the user to be cc’d on the email that it generates.

 Signature 

Upcoming ExpressionEngine Classes:
Portland, OR starting 7/13

Profile
 
 
Posted: 24 July 2007 09:19 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

FreeForm is slick- but are you definitely needing it to be entered as a weblog entry?  (Freeform does have a db table where submitted info is stored- but it’s not the same as putting it in a weblog.)

And I know FreeForm has hooks- anybody written an extension to put a copy in as a weblog entry?  I’d imagine it’s possible, but I haven’t dug into it.

Other option would be to write an extension to the SAEF that will send the email confirmation that way- could use ‘weblog_standalone_insert_entry’ as that happens just before the actual insert.  Should work.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 24 July 2007 09:28 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  01-23-2006

Thanks Rob.  I would prefer to have it as a weblog entry because the event they would be signing up for would already be an entry and if I could tie the event into the simple commerce module for payment that would be cool.

So how would you go about writing the extension that would send the confirmation email.  Can a PHP novice like me do that?

Profile
 
 
Posted: 24 July 2007 09:37 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

I might check out Solspace and just see if there’s already an extension that will put FreeForm submissions in a weblog.  I haven’t heard of one, but it could exist.

If it doesn’t, it’s easy to write an extension to the SAEF- see docs on extensions.  In truth, if you don’t know php it could take a little while.  If I can clear out the forum, I’ll take a quick poke at it for you- because I really don’t think it would be hard.  But I got to do some clearing out first.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 24 July 2007 09:39 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  01-23-2006

Cool, thanks Rob.  I’m gonna download FreeForm now.

Profile
 
 
Posted: 24 July 2007 10:31 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

If it will add a weblog entry, I’d go with that.  If not- did a quickie extension.  Works in a quick test and you should be able to modify as needed.  Just save it as ext.saef_mail.php, upload to extensions, enable- and it should email just before the weblog data are entered.  It’s simple, so you should spot how to tweak it.

<?php

class Saef_mail
{
var $settings  = array();

var
$name   = 'SAEF Mail Confirmation';
var
$version   = '1.0.0';
var
$description  = 'Emails confirmation after SAEF submission';
var
$settings_exist  = 'n';
var
$docs_url  = '';  //'http://expressionengine.com';

// -------------------------------
//   Constructor - Extensions use this for settings
// -------------------------------

function Saef_mail($settings='')
{
  $this
->settings = $settings;
}
// END

// -------------------------------
//   Send the mail
// -------------------------------

function do_mailing()
{
global $SESS, $REGX, $PREFS;


if ( !
class_exists('EEmail'))
{
  
require PATH_CORE.'core.email'.EXT;
}

$from
= $PREFS->ini('webmaster_email');
$send_to = $SESS->userdata('email');
$mssg = 'Your signup has been processed';
$subject = 'Email confirmation';

$email = new EEmail;

$email = new EEmail;
$email->wordwrap = true;
$email->mailtype = 'text';
$email->from($from);
$email->reply_to($from);
$email->to($send_to);
$email->subject($subject);
$email->message($REGX->entities_to_ascii($mssg));
$email->Send();

return;

}


// --------------------------------
//  Activate Extension
// --------------------------------

function activate_extension()
{
  
global $DB;
  
  
$DB->query($DB->insert_string('exp_extensions',
           array(
           
'extension_id' => '',
           
'class'  => "Saef_mail",
           
'method'    => "do_mailing",
           
'hook'   => "weblog_standalone_insert_entry",
           
'settings'  => "",
           
'priority'  => 10,
           
'version'   => $this->version,
           
'enabled'   => "y"
            
)
          )
      );
}
// END


// --------------------------------
//  Disable Extension
// --------------------------------

function disable_extension()
{
  
global $DB;

  
$DB->query("DELETE FROM exp_extensions WHERE class = 'Saef_mail'");
}
// END



}
// END CLASS

?>
 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 24 July 2007 11:37 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  01-23-2006

Thanks so much for this Rob.  When I try to enable it I get this error message:

Warning: Cannot modify header information - headers already sent by (output started at /www/username/public_html/system/extensions/ext.saef_mail.php:2) in /www/username/public_html/system/core/core.functions.php on line 296

Thanks again!

[Mod Edit: Removed sensitive security information such as user name and system directory.]

Profile
 
 
Posted: 24 July 2007 11:47 AM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

Most likely there’s some white space at the top/bottom of the file.  Though I got it a time or two as well- might have been a corrupted character.  I’ll attach a zip version of the final upload I tested on- that one shouldn’t have issues as it installed/deinstalled/worked for me.

File Attachments
ext.saef_mail.zip  (File Size: 1KB - Downloads: 208)
 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 24 July 2007 11:53 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  599
Joined  01-23-2006

That did it.  Thanks so much Rob.  This is a very useful extension.  I’m sure there are other people who would be interested in this as well.

Profile
 
 
Posted: 24 July 2007 11:56 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  24513
Joined  05-20-2002

Was a quick/easy one, no problem.  Though after I thought about it, might have been better to tie into one of the publish hooks.  But I didn’t dig into it further.  Still- based on the above, could try writing a new one.  Hook in after the data have actually been inserted.  Other than flipping out the hook, the core logic would be the same.  Not sure it’s really a difference worth worrying about, though.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 24 July 2007 11:57 AM   [ Ignore ]   [ # 11 ]  
Administrator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  36399
Joined  05-14-2004

I went ahead and wiki’d this extension. =)

 Signature 
Profile
MSG
 
 
Posted: 29 November 2007 05:23 PM   [ Ignore ]   [ # 12 ]  
Grad Student
Rank
Total Posts:  82
Joined  03-25-2006

This is exactly what I’ve been looking for.  My only question is how will this hook in to the POST data from the SAEF?  Would using plain old $_POST[‘variable’] be the ticket, or is some special EE code necessary like $SESS->postdata(‘variable’) or something?  Thanks.  This will be my first Extension hackage so just trying to find my way smile

Profile
 
 
Posted: 16 May 2008 03:39 AM   [ Ignore ]   [ # 13 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  105
Joined  09-08-2006

Just found this extension, handy for a job, Thank you.

Is it possible to restrict it to a specific weblog?
In other words: Only new entries that are submited to a specific weblog wilol trigger the SAEF mail extension to send out the notification email.

 Signature 

Stan Majerski
Elemental media

Profile
 
 
Posted: 15 October 2008 12:20 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  338
Joined  01-20-2006

Hey Robin. I just used this extension as a base, to create an automagical email sent to the logged in user, containing all the weblog entry content.
Can I send it your way for screening? approval? etc?

 Signature 

AJ Penninga
Pretty Squares, LLC - http://www.prettysquares.com

Profile
 
 
Posted: 13 January 2009 06:19 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  317
Joined  09-06-2006

Is this extension supposed to be compatible withe the current version (1.6.6 build 20081212)? Doesn’t seem to do anything for me.

 Signature 

Kyle Summer | smartpill design | New Haven, CT |  twitter

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 77536 Total Logged-in Users: 46
Total Topics: 101540 Total Anonymous Users: 25
Total Replies: 544316 Total Guests: 283
Total Posts: 645856    
Members ( View Memberlist )