Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#337 2021-11-13 06:42:43

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Re: com_connect - form and contact mailer

Hello,
I have com_connect with ext_file_attach. If I attach a file, a blank message will be sent with only the attachment. If I do not attach a file all fields are displayed in the message.

If I try to format my email via “body_form”, an empty email is also sent.

Instaled Textpattern 4.8.7. with PHP 7.4.23.

Does anyone have an idea? Unfortunately I don’t speak PHP;).
Thank you

Offline

#338 2021-11-13 06:55:31

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

hildebruns wrote #331939:

Hello,
I have com_connect with ext_file_attach. If I attach a file, a blank message will be sent with only the attachment. If I do not attach a file all fields are displayed in the message.

If I try to format my email via “body_form”, an empty email is also sent.

Instaled Textpattern 4.8.7. with PHP 7.4.23.

Does anyone have an idea? Unfortunately I don’t speak PHP;).
Thank you

Could you post the tags you are using? ext_file_attach works fine on my install.

Edited to remind you to anonymise your email before posting the tags here.

Last edited by colak (2021-11-13 06:58:08)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#339 2021-11-13 08:14:26

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Re: com_connect - form and contact mailer

Hi,

Formatting with “body_form” now works fine.
But when I attach a file, the message is blank but the attachment is sent.
Without an attachment, everything works as expected.

Form:

<txp:com_connect to='antrag@xxx.de/' from='noreply@xxx.de' label="" expire="2400" redirect='danke-landing' copysender="1" subject='Bereich <txp:section/>'  body_form="test_file_mail_mail" >                     
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_text type="text" break="" class="form-input" label="Vorname:*" placeholder="Vorname" name="vorname"/>                                                                                                        
    </div>                                                                                                                                                                                                                            
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_text type="text" break="" class="form-input" label="Nachname:*" placeholder="Nachname" name="nachname"/>                                                                                                     
    </div>                                                                                                                                                                                                                            
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_email break="" class="form-input" label="E-Mail:*" placeholder="E-Mail" name="email"/>                                                                                                                       
    </div>                                                                                                                                                                                                                            
    <div>                                                                                                                                                                                                                             
        <txp:com_connect_file required="0"  label="File" />                                                                                                                                                                           
    </div>                                                                                                                                                                                                                            
    <div class="btn-group mt-2 mb-2">                                                                                                                                                                                                 
        <txp:com_connect_submit label="Abschicken" class="btn btn-primary" style="border:none;"/>                                                                                                                                     
    </div>                                                                                                                                                                                                                            
</txp:com_connect>   

Mail form:

============
Email received.
<txp:com_connect_value name="vorname" />
<txp:com_connect_value name="nachname" />
<txp:com_connect_value name="email" />
============

Offline

#340 2021-11-13 09:34:57

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

What happens if you change <txp:com_connect_file required="0" label="File" /> to <txp:com_connect_file label="File" max="2000000" accept=".pdf,.docx,.doc,.txt,.rtf" required="0" />?

You can of course change the accepted extensions.

Also… try without the body_form.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#341 2021-11-13 09:48:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

In fact, there are some single quotes that need to be double ones there. try

<txp:com_connect to="antrag@xxx.de/" from="noreply@xxx.de" label="" expire="2400" redirect="danke-landing" copysender="1" subject="Bereich <txp:section/>">                     
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_text type="text" break="" class="form-input" label="Vorname:*" placeholder="Vorname" name="vorname"/>                                                                                                        
    </div>                                                                                                                                                                                                                            
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_text type="text" break="" class="form-input" label="Nachname:*" placeholder="Nachname" name="nachname"/>                                                                                                     
    </div>                                                                                                                                                                                                                            
    <div class="">                                                                                                                                                                                                                    
        <txp:com_connect_email break="" class="form-input" label="E-Mail:*" placeholder="E-Mail" name="email"/>                                                                                                                       
    </div>                                                                                                                                                                                                                            
    <div>                                                                                                                                                                                                                             
        <txp:com_connect_file label="File" max="2000000" accept=".pdf,.docx,.doc,.txt,.rtf" required="0" />                                                                                                                                                                       
    </div>                                                                                                                                                                                                                            
    <div class="btn-group mt-2 mb-2">                                                                                                                                                                                                 
        <txp:com_connect_submit label="Abschicken" class="btn btn-primary" style="border:none;"/>                                                                                                                                     
    </div>                                                                                                                                                                                                                            
</txp:com_connect>

Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#342 2021-11-14 07:28:48

hildebruns
Member
Registered: 2009-03-10
Posts: 35

Re: com_connect - form and contact mailer

Thank you Colak,

now it works.

Is it actually possible to send a different mail to the sender than to the admin?
In addition to the “body_form”, there is also a “sender_form”. That would make sense, especially with larger forms.
If the admin needs all the information but the sender only needs the confirmation.

Thanks

Offline

#343 2021-11-16 06:41:19

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

hildebruns wrote #331951:

Thank you Colak,

now it works.

Is it actually possible to send a different mail to the sender than to the admin?
In addition to the “body_form”, there is also a “sender_form”. That would make sense, especially with larger forms.
If the admin needs all the information but the sender only needs the confirmation.

Thanks

I’m sorry I can not help you on this, but I’m bumping this thread as someone with more knowledge may.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#344 2022-02-15 04:53:53

hidalgo
Member
From: Australia
Registered: 2008-02-05
Posts: 77
Website

Re: com_connect - form and contact mailer

I’ve hit a roadblock, is the ‘User selectable recipient, without showing email address’ example still valid?

<txp:com_connect_select label="Department" options=",Support,Sales" />
<txp:php>
    global $com_connect_form;
    switch($com_connect_form['Department'])
    {
        case 'Support':
            echo 'email+support@example.com';
            break;
        case 'Sales':
            echo 'email+sales@example.com';
            break;
        default:
            echo 'email+default@example.com';
    }
</txp:php>

I’ve tried this example above exactly (with valid emails), and everything else I can think of, but it always goes to the default address – despite the option selected. I’m using Textpattern 4.8.8 and com_connect 4.7.0 with PHP 8.

Offline

#345 2022-02-15 05:37:46

hidalgo
Member
From: Australia
Registered: 2008-02-05
Posts: 77
Website

Re: com_connect - form and contact mailer

hidalgo wrote #332749:

I’m using Textpattern 4.8.8 and com_connect 4.7.0 with PHP 8.

Update: I’ve rolled back to com_connect 4.6.0 and it’s now working correctly, so changes in 4.7.0 have broken this function/example.

Offline

#346 2022-02-15 07:45:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: com_connect - form and contact mailer

Oops, the example needs updating. Try this on the 2nd line of your php:

switch($com_connect_form['Department'][0])

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#347 2022-02-15 12:25:00

hidalgo
Member
From: Australia
Registered: 2008-02-05
Posts: 77
Website

Re: com_connect - form and contact mailer

Bloke wrote #332752:

Oops, the example needs updating. Try this on the 2nd line of your php:

switch($com_connect_form['Department'][0])...

Thanks for your help, this works!

Offline

#348 2022-02-18 17:35:20

slabanosa
Member
From: Silva Carbonaria
Registered: 2004-06-01
Posts: 57

Re: com_connect - form and contact mailer

Bloke wrote #331480:

Nope, the only thing you need is the plugin PHP file (and optionally the ReCaptcha library if using that). Once I’m happy it works as advertised I’ll fix the links and prepare a proper plugin installation file and register it with the central plugin repo.

Any update on this? have a site that’s being hammered through its contact form right now and host disabled it til i fix things. I’m clueless as to how to compile install ext_captcha.php found on github and have no idea, any hint/help/file ready for use zip file would be much appreciated :)

Offline

Board footer

Powered by FluxBB