Announcement

Collapse
No announcement yet.

Need to send email with the fields in the form

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need to send email with the fields in the form

    Hi,

    I need a form to subscribe people in a race, the the form needs to send an email notification to two email, the first to an administrator and the second to the same subscriptor with a autonumeric id and the same information in the form as ticket confirmation his subscription.

    I already solve the email notification to the administrator of the issue but I canīt solve sending the content of the form to the email was proportioned in the form to the subscriptor, can anyone help with this problem?

    Thanks in advance.

    Eduardo Cázares

  • #2
    What exactly is the problem? Is it not possible to send a second email or don't you know how to get the fields of the form in the email text? THe latest issue is a simple one. Depending on your form you need to add some code to an event. I.e. onafterinsert, onclick etc. Then you form your text using the fieldvariables like:

    $mytext='hello '.{mynamefield} etc.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Originally posted by aducom View Post
      What exactly is the problem? Is it not possible to send a second email or don't you know how to get the fields of the form in the email text? THe latest issue is a simple one. Depending on your form you need to add some code to an event. I.e. onafterinsert, onclick etc. Then you form your text using the fieldvariables like:

      $mytext='hello '.{mynamefield} etc.
      Exactly y have this code but I donīt know how to send the email with the same fields of the form, this is my code

      /**
      * Avisa que se inscribio un competidor
      */

      // Email parameters
      $mail_smtp_server = 'mail.mediomaratonnocturno7barrios.com'; // SMTP server name or IP address
      $mail_smtp_user = 'alertas@mediomaratonnocturno7barrios.com'; // SMTP user name
      $mail_smtp_pass = 'alertas'; // SMTP password
      $mail_from = 'alertas@mediomaratonnocturno7barrios'; // From email
      $mail_to = 'ecazares@quickad.com.mx'; // To email
      $mail_subject = 'Se inscribio un competidor'; // Message subject
      $mail_message = 'Se ha inscrito un competidor al evento - QuickadSoft'; // Message body
      $mail_format = 'T'; // Message format: (T)ext or (H)tml
      $mail_port = '26'; // Puerto Servermail con aut //

      // Send email
      sc_mail_send($mail_smtp_server,
      $mail_smtp_user,
      $mail_smtp_pass,
      $mail_from,
      $mail_to,
      $mail_subject,
      $mail_message,
      $mail_port,
      $mail_format);

      /**
      * Avisa que se inscribio un competidor
      */

      How can add code to send the fields?

      Thanks in advance

      Eduardo Cazares

      Comment


      • #4
        $mail_message = 'hello '.$mylocalvar.'.<br>';
        $mail_message = $mail_message.'these are my fields:<br>';
        $mail_message = $mail_message.'formfield 1: <b>'.{myformfield}.'</b><br>';
        $mail_message = $mail_message.'globalfield: <b>'.[myglobalfield].'</b><br>';

        to concatenate you can use .= and if you set the data between doublequotes you might not have to use the concatenation:

        $mail_message = "this is my field: {myfield}";

        but I have had issues with this in the past with SC parser.

        hope this helps
        Albert Drent
        aducom software netherlands
        scriptcase partner, reseller, support and (turn-key) development
        www.scriptcase.eu / www.scriptcase.nl

        Comment


        • #5
          Hi Albert,

          I apreciate the help, now I can send my field form in the email, but now I canīt send each field form in separate lines, all the field forms appear in one line, is possible to send the field forms in separate lines, my code is next ...

          $mail_smtp_server = 'mail.mediomaratonnocturno7barrios.com'; // SMTP server name or IP address
          $mail_smtp_user = 'alertas@mediomaratonnocturno7barrios.com'; // SMTP user name
          $mail_smtp_pass = 'alertas'; // SMTP password
          $mail_from = 'alertas@mediomaratonnocturno7barrios'; // From email
          $mail_to = 'ecazares@quickad.com.mx'; // To email
          $mail_subject = 'Se inscribio un competidor'; // Message subject
          $mail_message = 'Se ha inscrito un competidor al evento - QuickadSoft - ';
          $mail_message = 'Estos son los datos del corredor: ';
          $mail_message = $mail_message.'Nombre: '.{nombre}.' - ';
          $mail_message = $mail_message.'Email: '.{email};

          // Message body
          $mail_format = 'T'; // Message format: (T)ext or (H)tml
          $mail_port = '26'; // Puerto Servermail con aut //

          // Send email
          sc_mail_send($mail_smtp_server,
          $mail_smtp_user,
          $mail_smtp_pass,
          $mail_from,
          $mail_to,
          $mail_subject,
          $mail_message,
          $mail_port,
          $mail_format);

          Thanks in advance,

          Eduardo Cázares

          Comment


          • #6
            You missed the <br> thing. Send the mail as html (not T but H) and put a linebreak in your text. See my previous post for a sample. Otherwize you need to add \n to your lines to force a newline.
            Albert Drent
            aducom software netherlands
            scriptcase partner, reseller, support and (turn-key) development
            www.scriptcase.eu / www.scriptcase.nl

            Comment


            • #7
              Albert,

              And now, how can I send a email from the form with the same email in the form?

              $mail_to = {email};

              Or not?

              Thanks in advance.

              Eduardo Cazares

              Comment

              Working...
              X