ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Silence sign up on mailing list

May 11, 2012 12:45am

Subscribe [1]
  • #1 / May 11, 2012 12:45am

    eddyfever

    62 posts

    I use now phpmailer to send a email with a variable file this works great, but i would like that when someone requests a file that he also will silence signup for a specific mailing list. This so i can notify someone when changes are made for that downloaded file.

    But this get’s me stuck with 2 problems.

    - Is it possible to sign somebody up unnoticed to a mailing list, without doing this by hand?
    - And is is possible to do this in combination with the current form action, or to add a second form action?

    <form action="send_mail.php" method="post">
         <input type="hidden" name="url_title" value="{url_title}">
         <input type="hidden" name="voornaam" value="{voornaam}">
         <input type="hidden" name="achternaam" value="{achternaam}">
         <input type="hidden" name="vcard_file" id="vcard_file" value="{exp:jco_getfileinfo filename="{vcard_file}"}{file_path}{/exp:jco_getfileinfo}">
         <input class="textfield" type="text" name="Email" id="Email" placeholder="*uw emailadres">
         <input class="submit" type="submit" value="verstuur">
    </form>

    Hope somebody can help me with this.
    Thank you already for your time.

  • #2 / May 11, 2012 4:49am

    eddyfever

    62 posts

    I found a solution, so if you wanna know how:

    in phpmailer redirect after succes:

    <a href="http://mydomain.com/index.php/vcards/subcribe/.$_POST&#91url_title&#93./.$_POST&#91mailinglijst&#93./.$_POST&#91Email&#93.">http://mydomain.com/index.php/vcards/subcribe/".$_POST["url_title"]."/".$_POST["mailinglijst"]."/".$_POST["Email"]."</a>

    created a new page “subcribe” and used freeform, and then a auto submit with java:

    [removed]
    
            function onLoad() {
                document.getElementById("email").value="{last_segment}";
                document.getElementById('form').submit();
            }
    
        [removed]
    
    </head>
    
    <body>
    
    <div>
    {exp:freeform:form
       collection="vcard signup"
       return="vcards/{segment_3}/vcard_succes"
       mailinglist="{segment_4}"
       mailinglist_opt_in="no"
       form:id="form"  
    }
    
    <input class="textfield_fullwidth" id="email" type="text" name="email" placeholder="" value="{last_segment}">
    
      <input class="submit_fullwidth" type="submit" id="ajax_mailinglist_submit" value="aanmelden nieuwsbrief">
    {/exp:freeform:form} 
    </div>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases