Forums

email and curl submitting twice

hastings 05 Aug, 2015
Debug info below which shows the email being sent twice, its received twice also.

Configuration data replaced with xxxx for security reasons.

Array
(
    [13] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:xxx
                    [2] => Subject:Storage Quote - New Lead
                    [3] => From name:Sentry Self Storage
                    [4] => From email:
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:
                    [8] => Reply email:
                    [9] => Attachments:
                    [10] => Array
                        (
                        )

                    [11] => Body:
<table>
<tr><td>Select your location</td><td>Andover</td></tr>
<tr><td>Space Required</td><td>40</td></tr>
<tr><td>When </td><td>Urgent</td></tr>
<tr><td>First Name</td><td>jon</td></tr>
<tr><td>Last Name</td><td>hastin</td></tr>
<tr><td>Email</td><td></td></tr>
<tr><td>Telephone</td><td></td></tr>
<tr><td>Comments</td><td></td></tr>
</table><br /><br />IP: xxxxxx
                    [12] => An email with the details below was sent successfully:
                    [13] => xxx
                    [14] => Subject:Storage Quote - New Lead
                    [15] => From name:xxxx
                    [16] => From email:
                    [17] => CC:
                    [18] => BCC:
                    [19] => Reply name:
                    [20] => Reply email:
                    [21] => Attachments:
                    [22] => Array
                        (
                        )

                    [23] => Body:
<table>
<tr><td>Select your location</td><td>Andover</td></tr>
<tr><td>Space Required</td><td>40</td></tr>
<tr><td>When </td><td>Urgent</td></tr>
<tr><td>First Name</td><td>jon</td></tr>
<tr><td>Last Name</td><td>hastin</td></tr>
<tr><td>Email</td><td></td></tr>
<tr><td>Telephone</td><td></td></tr>
<tr><td>Comments</td><td></td></tr>
</table><br /><br />IP: xxxxxxx
                )

        )

    [21] => Array
        (
            [Curl] => Array
                (
                    [0] => CURL OK : the CURL function was found on this server.
                    [1] => $curl_values: firstname=jon&lastname=hastin&email=&telephone=&When=Urgent&spacerequirement=40&location=Andover
                    [2] => curl_target_url: xxxx
                    [3] => curl_errors: 
                    [4] => curl_info: Array
(
    [url] => xxxx
    [content_type] => text/html
    [http_code] => 200
    [header_size] => 167
    [request_size] => 244
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.109
    [namelookup_time] => 0.015
    [connect_time] => 0.031
    [pretransfer_time] => 0.031
    [size_upload] => 96
    [size_download] => 2
    [speed_download] => 18
    [speed_upload] => 880
    [download_content_length] => 2
    [upload_content_length] => 96
    [starttransfer_time] => 0.109
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => xxxx
    [certinfo] => Array
        (
        )

    [primary_port] => xx
    [local_ip] => xxxx
    [local_port] => xxxx
)

                    [5] => CURL OK : the CURL function was found on this server.
                    [6] => $curl_values: firstname=jon&lastname=hastin&email=&telephone=&When=Urgent&spacerequirement=40&location=Andover
                    [7] => curl_target_url: xxxxx=
                    [8] => curl_errors: 
                    [9] => curl_info: Array
(
    [url] => xxxxx
    [content_type] => text/html
    [http_code] => 200
    [header_size] => 167
    [request_size] => 244
    [filetime] => -1
    [ssl_verify_result] => 0
    [redirect_count] => 0
    [total_time] => 0.093
    [namelookup_time] => 0
    [connect_time] => 0.015
    [pretransfer_time] => 0.015
    [size_upload] => 96
    [size_download] => 2
    [speed_download] => 21
    [speed_upload] => 1032
    [download_content_length] => 2
    [upload_content_length] => 96
    [starttransfer_time] => 0.093
    [redirect_time] => 0
    [redirect_url] => 
    [primary_ip] => xxx
    [certinfo] => Array
        (
        )

    [primary_port] => xx
    [local_ip] => xxxx
    [local_port] => xxxx
)

                )

        )

)
GreyHead 05 Aug, 2015
Hi Hastings,

The obvious explanation would be that there are two email actions enabled; or some kind of loop in the events - though that's not easy to do.

Bob
hastings 05 Aug, 2015
Hi Bob,

There are not two emails enabled, please see attached screenshot. I've been trying lots of different things to resolve the issue and added a second curl which you can see but only one email.

The loop I'm not clear about as I'm not sure why this would occur unless you're suggesting some kind of bug that I wouldn't be aware of?

Thanks,
Jon.
GreyHead 05 Aug, 2015
Hi hastings,

What are the three events intended to do? I suspect that what might be happening is that somehow the the 'submit' event is (a) loading the 'submit2' event, then submitting to the 'submit2' event ? ? ?

Bob
hastings 05 Aug, 2015
Hi Bob,
all I'm trying to achieve is a two part form, on the home page some details are added (the on-load part of the form) and then these are passed to the second part of the form (on submit) where the additional details are added - when this is submitted the email should be sent.

The curl action which should also send these form details to a database.

The only reason the email was added was because the form was being submitted twice into the database so to troubleshoot this I added an email action, and this also is submitted twice. Having taken it apart several times and performed troubleshooting, I concluded it may be a bug in Chronoforms??

Thanks,
Jon.
GreyHead 05 Aug, 2015
Hi hastings,

I don't know of any bug that would explain this - really the email action has somehow to be run twice to get two email sent. Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM me for an email address if you prefer and I'll take a closer look.

Bob
hastings 05 Aug, 2015
Hi Bob, attached is the backup of the form as requested.
Many thanks in advance for the help, its become somewhat of an insoluble issue.

Jon.
hastings 05 Aug, 2015
Hi Bob, was the backup okay?
Are you as mystified as us?

Jon.
GreyHead 06 Aug, 2015
Hi Hastings,

Yes, the backup was fine - and then we had visitors arrive . . .

The first things to check is the HTML (Render Form) action in the On Load event. That is set to use GET as the action, please change that back to POST and the Action URL is something that probably doesn’t exist. Please remove that - it you need to add an action URL set it to the full URL for the form On Submit event.

To tidy up, please change the second container on the Designer tab to Type Page.

You also need to add Multi Page actions to at least the submit and submit2 events so that the data is carried through. They should be the first action in each event.

Lastly, please add a From Email matching the domain name to the Email action to prevent errors there.

When I submit from the second page then I only get one email and one curl so I suspect that the problem is the odd sequence of events. Hopefully the changes above will fix that.

Bob
hastings 06 Aug, 2015
Thanks Bob, one of your suggestions fixed the issue.

Much appreciated, and thanks again.

Jon.
This topic is locked and no more replies can be posted.