Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Auto Sending Welcome Email

Aloittaja aces_pancakeman, toukokuu 07, 2014, 05:53:09 IP

« edellinen - seuraava »

aces_pancakeman

Hi everyone,

let me preface this by saying that I'm not completely fluent when it comes to admin-ing forums. It was kind of dumped on me, but I have a little understand.

Anyway, the problem we're having is thus: We require people to apply in order to join our corporation. They fill out an application form, which then gets auto-submitted for review and approval. We try to be professional, and send a welcome email outlining what is expected of the applicant.

Currently, this email is submitted through a copy and paste process, in essence, it's done manually. We would like to have the welcome email sent automatically as soon as the application is submitted, thus freeing up time for other duties.

It appears this can be done, but I have no idea how. Any feedback would be welcome and appreciated.

Thanks!

margarett

Hi and welcome to SMF ;)

Email templates are stored in a languages file. You can edit the corresponding bit, which can be a bit... difficult.
You can also use this MOD --> http://custom.simplemachines.org/mods/index.php?mod=2926

Now... What you describe doesn't seem to be the default SMF registration mechanism. When you select "Admin approval" for the registration settings, yes, you can receive an information by email, but it's not really a "custom" form the user filled... It's SMF's default email template for that information.
Can you give us your SMF version and list of installed MODs?
Maybe a link to your forum?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 07, 2014, 06:44:38 IP
Hi and welcome to SMF ;)

Email templates are stored in a languages file. You can edit the corresponding bit, which can be a bit... difficult.
You can also use this MOD --> http://custom.simplemachines.org/mods/index.php?mod=2926

Now... What you describe doesn't seem to be the default SMF registration mechanism. When you select "Admin approval" for the registration settings, yes, you can receive an information by email, but it's not really a "custom" form the user filled... It's SMF's default email template for that information.
Can you give us your SMF version and list of installed MODs?
Maybe a link to your forum?

Sure can. I've figured out how to edit the email. I just can't get the forum to auto-send the email once an application is submitted.

Our website is here: http://www.aces-hq.com/index.php [nofollow]

margarett

Admin panel --> Members --> Registration --> Settings --> "Notify administrators when a new member joins"
IF you are talking about registration in SMF.

If you are talking about this:
http://www.aces-hq.com/index.php?page=page1

Then that's NOT SMF standard and you must have something like Custom Pages or Custom Form MOD...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 07, 2014, 07:31:10 IP
Admin panel --> Members --> Registration --> Settings --> "Notify administrators when a new member joins"
IF you are talking about registration in SMF.

If you are talking about this:
http://www.aces-hq.com/index.php?page=page1 [nofollow]

Then that's NOT SMF standard and you must have something like Custom Pages or Custom Form MOD...

Well, once that application has been filled out and submitted, it gets automatically moved into another forum section. We would like the forum to send an email automatically to the applicant when the application is submitted.

How would one get a mod for that?

margarett

That's probably Custom Form (or maybe any self-developed code...)
Can you get us a list of installed MODs? (from your admin --> Package Manager)

If I'm right, you should only need to subscribe that board and you should automatically be awarded an email any time a new topic is created there ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 07, 2014, 07:41:44 IP
That's probably Custom Form (or maybe any self-developed code...)
Can you get us a list of installed MODs? (from your admin --> Package Manager)

If I'm right, you should only need to subscribe that board and you should automatically be awarded an email any time a new topic is created there ;)

We're not looking for email to be sent when a topic is created or replied to.

Something like  Person applies-->Hits Submit> Forum sends a welcome to ACES email.

Currently installed mods:

1.   SMF 1.1.19 / 2.0.6 Update    1.0     
2.   SMF 2.0.3 Update    1.0     
3.   Table Plus BBCodes    1.2 
4.   SMF 2.0.4 Update    1.0 
5.   Gamer IDs    1.4     
6.   smurfy - Mwo Mechlab BBC    1.0     
7.   Event Registration Mod    0.177 BETA   
8.   SimplePortal    2.3.5     
9.   Simple Twitter    1.2 
10.   Event Reminder Mod for SMF2    2.09     
11.   Add Social Media Icons To Profiles    1.0.7     
12.   Ultimate Profile    0.9.1     
13.   KeyCAPTCHA for SMF    2.4     
14.   Member Awards    2.2.3     
15.   Event Registration Mod for SMF2    2.26     
16.   SMF 2.0.5 Update    1.0     
17.   Aeva Media    1.4w     
18.   Bad Behavior mod    1.5.12 

margarett

It can be a whole lot of things, sorry... Maybe even a SP block with custom code inside, that we can never guess what it does...

When you say:
Lainaaonce that application has been filled out and submitted, it gets automatically moved into another forum section
Do you mean a topic is automatically created in a certain board, or...?
Because if that is the case, the notification of that board would probably be the easiest option...

What you have is clearly not a SMF standard functionality so, in order to help you, we need as much information as you can possibly give ;)

edit: moved
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 07, 2014, 08:09:13 IP
It can be a whole lot of things, sorry... Maybe even a SP block with custom code inside, that we can never guess what it does...

When you say:
Lainaaonce that application has been filled out and submitted, it gets automatically moved into another forum section
Do you mean a topic is automatically created in a certain board, or...?
Because if that is the case, the notification of that board would probably be the easiest option...

What you have is clearly not a SMF standard functionality so, in order to help you, we need as much information as you can possibly give ;)

edit: moved

Ah, I think I might have missed something. The welcome email is sent to the APPLICANT, to welcome them to our forums and whatnot.

I've got the topic reply email figured out. :)

margarett

OK, and that mail is supposed to be sent when the user registers at SMF or when the user submits the application at http://www.aces-hq.com/index.php?page=page1 ?

edit: if it's the first case, the user already receives an automatic email. The content is at Themes/default/languages/EmailTemplates.php

'resend_pending_message' => array(
/*
@additional_params: resend_pending_message
REALNAME: The display name for the member receiving the email.
USERNAME:  The user name for the member receiving the email.
@description:
*/
'subject' => 'Welcome to {FORUMNAME}',
'body' => 'Your registration request at {FORUMNAME} has been received, {REALNAME}.

The username you registered with was {USERNAME}.

Before you can login and start using the forum, your request will be reviewed and approved.  When this happens, you will receive another email from this address.

{REGARDS}',
),
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 07, 2014, 08:30:07 IP
OK, and that mail is supposed to be sent when the user registers at SMF or when the user submits the application at http://www.aces-hq.com/index.php?page=page1 [nofollow] ?

When the user submits the application.

aces_pancakeman

:/ I still can't figure anything out.

margarett

Sorry, missed this.

Well, in that case, it has to be the application's code to send the email, there is nothing SMF itself can do about it... Without us knowing what exactly shows and processes that application form, we can't really help you any further...

Check your ACP for blocks in SimplePortal that might do that. Who built your forum/site? Can't you contact them and ask for help on this?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

Lainaus käyttäjältä: margarett - toukokuu 09, 2014, 06:36:45 IP
Sorry, missed this.

Well, in that case, it has to be the application's code to send the email, there is nothing SMF itself can do about it... Without us knowing what exactly shows and processes that application form, we can't really help you any further...

Check your ACP for blocks in SimplePortal that might do that. Who built your forum/site? Can't you contact them and ask for help on this?

Can I edit the block it was created on with an auto-submit code? ie, just add code at the end?

As far as how the site was created, I pretty much inherited it. :/

margarett

Of course you can. Can we see the code in use?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

#15
Oops, sorry it took so long. I was out of the country for few days.

This is the code used for our application email (I hope that's what you meant) :



global $sourcedir, $context, $scripturl, $user_info;

///// ZP Edit - Globals below replaced by the above

//global $sourcedir, $ID_MEMBER, $context, $scripturl, $user_info, $db_prefix;

// Generic Application Form

// Originally created by JPDeni, TinyPortal Coding Goddess, reference the topic below:

// URL: http://www.tinyportal.net/index.php?topic=29670.msg236779#msg236779

// Date: 30 November 2009

//

// Edited on 6 June, 2010 by ZarPrime to work with SMF 2.0 RC3 and TinyPortal 1.0 beta 5 (Polls not enabled in this version)

// Guests can't fill out the form

if ($context['user']['id'] == 0)

    echo '<center>You must be registered on our site before you can enlist in A.C.E.S.

<p>

<a href="/index.php?action=register">You can register here</a>

</center>

';

else {

  require_once($sourcedir . '/Subs.php');

  require_once($sourcedir .'/Subs-Post.php');


// CONFIGURATION SECTION

   $intro_form = "<p>Hello and welcome to the application process for A.C.E.S.</p>

<p>Some things to know before continuing:<br />

<ul><br />

<LI>Complete sentences, grammar, and putting effort into answering this application will weigh heavily on your application process. Remember, first impressions mean a lot.<br />

<br />

<LI>This application is a general entry into the A.C.E.S. Mercenary Corporation.  Once in, you may have the opportunity to apply for membership into the Competitive Team.  The Competitive team is composed of the Unit Leaders and select members of A.C.E.S. that form the Elite Tip of our Spear.  The Competitive team has its own requirements and practice schedules to maintain a Razor edge in the High Tier Competition of MWO.<br />

<br />

<LI>Upon acceptance, you will be assigned the rank of Joker; You will be expected to act as a member of our unit, even with this title. You will be moved up to full member status (Jack) once we have gotten to know you better.<br />

<br />

<LI>We of course ask that all our members be active on Teamspeak and in-game. We like to set ourselves aside from other clans and units by maintaining a relatively close-knit relationship between our members. These naturally can take a while to develop, but the sooner we can start getting to know you, the sooner we will be able to call each other comrades.<br />
</ul></p>";

// Define your fields. All of these values need to be defined, even if they are empty.

// The fields will be displayed in the order in which they are listed in the array.

// $fielddef =

//   array(

//     array(

//       'caption' =>      "", // caption to be displayed on the form. Can include symbols and spaces.

//       'name' =>         "", // a unique name for the field. No symbols or spaces

//       'type' =>         "", // text, radio, select, checkbox, textarea, heading

//       'options' =>      "", // for radio and select fields. List in order you wish them to appear, separated by commas; for checkboxes, it's the value to be saved and displayed next to the box

//       'defaultvalue' => "", // the default value for the field. Can be a variable or text. Be sure to enclose text in quotation marks

//       'required' =>     0   // 0 or 1 -- use 1 if the field must be filled out. use 0 if it's optional; never set a checkbox to be required

//     ),

//   );

   $fielddef =

       array(

           array(

               'caption' =>        "Callsign:

                               <br>What is your Pilot/Profile name in MWO",

               'name' =>            "nickname",

               'type' =>            "text",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),

           array(

               'caption' =>        "Your Name:

                                    ",

               'name' =>            "realname",

               'type' =>            "text",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        0

           ),

           array(

               'caption' =>        "Location:

                               <br>Where are you located? Or what is your time zone",

               'name' =>            "location",

               'type' =>            "text",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),         

           array(

               'caption' =>        "*Age:

                               <br>We ask this question to get to know you better. A.C.E.S. also has a soft age limit of 18",

               'name' =>            "age",

               'type' =>            "text",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        0

           ),

           array(

               'caption' =>        "Requested Role:

                               <br>This is the role you feel the most comfortable with at the moment. This is not locking you into this role. It is just for general information",

               'name' =>            "role",

               'type' =>            "select",

               'options' =>        "Recon/Scout,Light Support,Heavy Support,Assaulter,Brawler,Sniper",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),           

           array(

               'caption' =>        "Why are you interested in joining A.C.E.S. ? What makes us different from other units? Explain why you thought that particular thing made us rise above other prospective units",

               'name' =>           "joinreason",

               'type' =>            "textarea",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1

           ),

           array(

               'caption' =>        "Tell us a bit about yourself",

               'name' =>            "bio",

               'type' =>            "textarea",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),

           array(

               'caption' =>        "*Where did you hear about A.C.E.S",

               'name' =>            "referral",

               'type' =>            "textarea",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),

array(

               'caption' =>        "*Additional Comments",

               'name' =>            "comments",

               'type' =>            "textarea",

               'options' =>        "",

               'defaultvalue' =>    "",

               'required' =>        1 

           ),

           

       );

   //send the application by email?

   $enable_email = false;

   // email address of recruitment staff member

   $email_address = '';

      // Thank you text

      $thanks_text = 'Application Submitted. Thank you for submitting this application. An officer of A.C.E.S will review your dossier in the next 24 hours. After review you will be contacted when it is processed.';

   //post the application on forum?

   $enable_post = true;

   //board id to which the application should be posted

   $board_id = 10; //(single digit only. No decimals)

   //END OF CONFIGURATION SECTION

////////////////////////////////////////////////////////////////////////////////////////////


   $show_form = 'true';

   if (isset($_REQUEST['submitted'])) {  // Handle the form

       // Check required fields

       $errors = array(); //Initialize error array   

       foreach ($fielddef as $field)

           if (empty($_REQUEST[$field['name']]) && ($field['required'] == 1))

               $errors[] = $field['name'];

   

       // There's at least one field missing

       if (isset($errors[0])) {

           foreach ($_REQUEST as $key => $value)

               $fieldvalue[$key] = $value;

       }

       else { // all is well

           $show_form = 'false';

           

           if ($enable_email)    {  // email an application

               $subject = 'Application';

               $body = '';

               foreach ($fielddef as $field) {

                   if ($field['type'] == 'heading')

                       $body .= $field['caption'] . '

                   ';

                   else

                       $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '

                   ';

               }

               mail($email_address, $subject, $body,"From: " . $user_info['email']);

           }

           

           if ($enable_post) {  //create new forum post with application

               $postbody = 'Forum post autogenerated by application form on behalf of ' . $context['user']['name'] .'<br /><br />';

               $fieldCounter = 0;

               foreach ($fielddef as $field) {

                   $fieldCounter++;

                   // Now we aren't going to print the headings or the subject in the post

                   if ($field['type'] == 'heading' || $field['name'] == 'subject')

                       echo '

                       <br />';

                   else

                       $postbody .=  $fieldCounter . '. [b]' . $field['caption'] . '[/b][list][li]' . $_REQUEST[$field['name']] . '[/li][/list]<br />';

               }

               $msgOptions = array(

                   'id' =>  0,

                   // Use the one below if poster doesn't enter subject

                   'subject' => '[Pending] Application of ' . addslashes($_REQUEST['nickname']),

                   // Use the one below if poster does enter subject

                   //'subject' => ($_REQUEST['subject']),

                   'body' => ($postbody),

                   'icon' => 'xx',

                   'smileys_enabled' => true,

                   'attachments' =>  array(),

               );

               $topicOptions = array(

                   'id' => 0 ,

                   'board' => $board_id,

                   'poll' =>  null,

                   'lock_mode' =>  null,

                   'sticky_mode' =>  null,

                   'mark_as_read' => true,

               );

               $posterOptions = array(

                   'id' => $context['user']['id'],

                   'name' => $context['user']['name'],

                   'email' => $user_info['email'],

                   'update_post_count' => true,

               );

               createPost($msgOptions, $topicOptions, $posterOptions);

           }

// Text for thank you page

           echo $thanks_text;

       }

   }

   else {

       foreach ($fielddef as $field) {

           $fieldvalue[$field['name']] = $field['defaultvalue'];

       }

   }

// Looks like you want the form,

   if ($show_form == 'true') {

       echo $intro_form . '<br />';

       if (isset($errors[0]))

           echo '

           <div style="color: red;">Please fill in all fields, those with an asterisk are required(*).</div>';

       echo '

   <form action="' . $scripturl . '?page='  . $_GET['page'] . '" method="post">

       <input name="submitted" type="hidden" value="true" />

       <table style="margin-left:auto; margin-right:auto;">';

       $bg = 'windowbg2';

       foreach ($fielddef as $field) {

           // Headings have their own type of display

           if ($field['type'] == 'heading') {

               echo '

           <tr>

               <td colspan="2" style="text-align: center; text-decoration: underline;">

                   ' . $field['caption'] . '

               </td>

           </tr>';

           }

           else {

               // How each field is displayed in the table

               echo '

           <tr class ="' . $bg . '">

               <td align="left">';

             if ($field['required'] == 1) { echo '* '; }

             echo $field['caption'] . ':

               </td>

               <td align="left">';

               // Go through each field type

               if ($field['type'] == 'text') {

                   echo '<input name="' . $field['name'] . '" type="text" value ="' . $fieldvalue[$field['name']] . '" />';

               }

               elseif ($field['type'] == 'radio') {

                   $options = explode(',',$field['options']);

                   foreach ($options as $option) {

                       echo '<input type="radio" name="' . $field['name'] . '" value="'. $option . '"';

                       if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']])) { echo ' checked'; }

                       echo '>' . $option . ' ';

                   }

               }

               elseif ($field['type'] == 'checkbox') {

                   echo '<input type="checkbox" name="' . $field['name'] . '" value="'. $field['options'] . '"';

                   if (isset($fieldvalue[$field['name']]) && ($fieldvalue[$field['name']]==$field['options'])) { echo ' checked'; }

                   echo '>' . $field['options'];   

               }

               elseif ($field['type'] == 'select') {

                   echo '<select name="' . $field['name'] . '" />';

                   $options = explode(',',$field['options']);

                   foreach ($options as $option) {

                   

                       echo '<option value="' . $option . '"';

                       

                       if ((isset($fieldvalue[$field['name']])) && ($option == $fieldvalue[$field['name']]))

                           echo ' selected';

                           

                       echo '>' . $option . '</option>';

                   }

                   echo '</select>';

               }   

               elseif ($field['type'] == 'textarea') {

                   echo '<textarea name="' . $field['name'] . '" rows="5" cols="80">';

                   echo $fieldvalue[$field['name']];

                   echo '</' . 'textarea>';

               }

               // Finish off the row

               echo '

               </td>

           </tr>';

           }

           // Set up the alternating colors for the next row

           ($bg == 'windowbg2') ? $bg = 'windowbg' : $bg = 'windowbg2';

       }

       echo '

           <tr class ="' . $bg . '">

               <td colspan="2" align="center">

                   <input type="submit" value="Submit">

                   <input type="reset" value="Reset">

               </td>

           </tr>

       </table>

   </form>';

   }

}

Kindred

Please use code tags when posting walls of code text
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

aces_pancakeman

Lainaus käyttäjältä: Kindred - toukokuu 15, 2014, 09:12:33 IP
Please use code tags when posting walls of code text

Oops, sorry. I wasn't sure how to do it :/

margarett

I would say that we can just pick the existing function for emailing the form to staff (currently disabled) and modify it for your needs
You have this:
           if ($enable_email)    {  // email an application
               $subject = 'Application';
               $body = '';
               foreach ($fielddef as $field) {
                   if ($field['type'] == 'heading')
                       $body .= $field['caption'] . '
                   ';
                   else
                       $body .= $field['caption'] . ': ' . $_REQUEST[$field['name']] . '
                   ';
               }
               mail($email_address, $subject, $body,"From: " . $user_info['email']);
           }

You can have something like (add after previous code):
   //Email application to the member submitting it
   $email_address = $context['user']['email'];
   $subject = 'Thank you for your Application';
   $body = 'Thank you for application at ACES. We will review it and reply shortly.';
   mail($email_address, $subject, $body,"From: [email protected]");

Please note that I didn't test this, so it might be prone to errors :P
You can of course edit subject and body. Also please correct that "[email protected]" as it is for sure wrong. Make it a valid address ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

aces_pancakeman

WOOHOO! It works! Thanks *SO* much for your help. That's exactly what I needed. If I ever meet you, allow me to buy you a beer. Thank you so much!

Advertisement: