cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




Mailing list signups by filtering email field

Add a New Topic Reply to Post
Post

Bluesplinter - Guest

10:31 pm - August 20, 2008

lease replace the ??? with your data!

  • Your URL: http://???
  • The browser used: Firefox 3
  • cforms version: 8.6
  • Your Wordpress version: 2.6.1

[desc]: I use cforms II for my site's main contact form, and it works great. I am trying to add a second form that will allow the visitor to join an externally hosted ezmlm mailing list, and I'm having a bit of trouble.

The form consists simply of an {Email} field.  When the user submits the form, I need to take that value, and manipulate it like this:

john@example.com

listname-subscribe-john=example.com@listdomain.com

The new format now becomes the "TO:" value.  IOW, I need to manipulate the form's {Email} value after validation -- which I can do with the filters in my-functions.php -- and have that new value included as the Admin's Email list.  Thus, I would get a copy, and a copy would go straight to the ezmlm list manager.

First problem, I have to use smtp, so the @mail() examples in your my-functions.php code won't do.  I would like to handle this in one smtp session, but I don't know how to use the filters to add the new "TO:" value to the original form's Admin Email list (even making the new value a CC or BCC would suffice).

Any ideas?  I tried one workaround, by creating a hidden field that would hold the new, calculated value, like so:

Email: john@example.com

Join_Address: listname-subscribe-john=example.com@listdomain.com

I have successfully used the post-validation filters to set the Join_Address field, but I don't know how to use the Join_Address field as one of the TO:, CC:, or BCC's.

Any help would be great :)

Thanks,

Steve

_

Oliver - Admin

7:57 am - August 21, 2008

posts 3656

First problem, I have to use smtp, so the @mail() examples in your my-functions.php code won't do.

That was merely a quick example, feel free to add or modify anything you need.

I have successfully used the post-validation filters to set the Join_Address field, but I don't know how to use the Join_Address field as one of the TO:, CC:, or BCC's.

Cool to see users getting beyond the 'contact me' stage :-)

re: TO:, CC:, or BCC's there are limitations to what you can do, partially for security reasons.

BCC:

  • the address can only be configured/modified via the cforms admin page

CC:

  • isn't in fact a real CC, it's a duplicate of the email going out to the submitting user, if the user selected the CC checkbox.
  • the address is taken from the user input and can't currently be modified post submission

TO (admin email):

  • seems like the way to go:
    • give your hidden field (with the new Join_Address) a specific ID,e.g.
      [id:Join_Address]
    • reference this ID in the 'admin email address' config line, e.g.
      {Join_Address}
    • add this:
      $to = stripslashes( check_cust_vars($to,$track,$no) );
      before line:
      // SMTP server or native PHP mail() ?
      in both lib_ajax.php and lib_nonajax.php

This is off top of my head but should do.

Add a New Topic Reply to Post


Reply to Topic: Mailing list signups by filtering email field
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 9 + 7        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.3 (Build 356)