Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2018-12-12 17:01:57

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

Re: com_connect - form and contact mailer

dragondz has flagged up that some people don’t use the label attribute but use placeholders instead to indicate what users are expected to supply.

It’s of course possible to use label="" to suppress them, but that also means the default email that’s sent out doesn’t have the label(s) in front of the fields content. Even specifying the name attribute doesn’t fix this.

You can get around that by making your own body_form for the email body and hard-coding your own labels in.

Question is: are these workarounds okay or can/should we do something better in the default email template? A few options I’ve come up with, none of which are particularly appealing:

  1. Leave it alone – the body_form attribute suffices for such cases.
  2. Introduce some flag attribute to control this behaviour, like display_label and set it true by default. Bonus points for being able to override it on the containing <txp:com_connect> tag for all contained tags.
  3. Automatically fall back on the name field (although that might backfire with things like checkboxes/radios because their name is auto-generated in some cases, I think).
  4. Introduce a new attribute that can be used as the field label that appears in the email. Defaults to label unless this overrides it.
  5. Set some user-definable priority system up on the container tag that allows you to define what happens, e.g. placeholder:label:name:"Field" would search the given fields in the given order and use the last entry as a fallback label in the email if all the previous ones were empty. Would only apply to the built-in message body, which is not ideal from a usability stance.
  6. Something else…

Anyone have any views on this? Is it a problem we should tackle? If so, how?


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

#146 2018-12-12 19:06:06

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

Re: com_connect - form and contact mailer

What if the plugin detects if there are labels and if not, the placeholder names are sent?

Too much maybe?


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

Offline

#147 2018-12-13 07:42:53

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: com_connect - form and contact mailer

Hi, for me the solution 2 should be ok if it s simple to code.

Offline

#148 2018-12-21 07:51:11

zenman
Member
Registered: 2017-08-28
Posts: 41
Website

Re: com_connect - form and contact mailer

Hello!

Is there any way to integrate the txp:com_connect form into a CRMs. In my case as far as I see it should be made like this: Request POST

http://site.com?token={dealer_token}. 

How can I attach this “tail” ?token={dealer_token} to submited forms’ URLs?

Offline

#149 2018-12-21 09:52:08

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: com_connect - form and contact mailer

Just in case, you could try to insert

<input type="hidden" name="token" value="dealer_token_value" />

into your form, though this requires that CRM gets token from POST data.

Offline

#150 2018-12-24 08:01:01

zenman
Member
Registered: 2017-08-28
Posts: 41
Website

Re: com_connect - form and contact mailer

etc wrote #315666:

Just in case, you could try to insert

<input type="hidden" name="token" value="dealer_token_value" />...

into your form, though this requires that CRM gets token from POST data.

Thanks. It does not work this way. The manual suggests the following code for JavaScript:

var request = new XMLHttpRequest();
request.open('GET', 'https://private-anon-e12e0a7fe4-ramex.apiary-mock.com/treatment/sources?token=3.844e83ae03647071f77bb...');
request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log('Status:', this.status);
    console.log('Headers:', this.getAllResponseHeaders());
    console.log('Body:', this.responseText);
  }
};
request.send();

Or PHP below. Can it be integrated with txp:com_connect somehow?

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://private-anon-e12e0a7fe4-ramex.apiary-mock.com/treatment/sources?token=3.844e83ae03647071f77bb...");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);You haven’t made

Last edited by zenman (2019-01-16 18:35:02)

Offline

#151 2019-01-11 10:41:02

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: com_connect - form and contact mailer

Is there anything I need to do to get com_connect to work with pap_contact_cleaner?

The form is working fine, both plugins enabled, but the hidden fields from pap_contact cleaner aren’t appearing.

Offline

#152 2019-01-11 10:56:15

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

Re: com_connect - form and contact mailer

The one below works for me.

# Name: pap_comconnect v0.1.2 (compressed)
# Type: Public plugin
# Prevent Spam through com_connect
# Author: tranquillo and Stef
# URL: https://forum.textpattern.com/viewtopic.php?pid=312784#p312784
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

H4sIAAAAAAAAA4VUUW/aMBB+Bqn/4ZZOC5W6pElpoSllmva0t0ndniOTXIg1x/bsCx3q+t/n
OKGAijYJCed89/n7vvOZZUmSPdtsmgWSNRjc2yxxa810XqimUFJiQV30NgtYS7UyPuUuC8gw
+avlQihgsoRHwspvXe0S89ZwX5lkQU2kbRbHlTJtExH+Js2I0MiIq3jD8YmU5kWka/1J8/Lh
Okln8+m57v87kFkWbNBYrmT3dZMFV1ESpf5AB1+iLQzXNGxfp1nwzeAGJcGjZg1QbVS7rsFJ
yg80OaGFKr3o2dRJMrjm1rHKCybEihU/J+GxEbnj34SX4T4S+cjF/dn4/8W2XTWcjsuHWAdw
Nq5aWXQa4MSpkwt47nJG7yuOooQHCBcl34ClrcCHYMMtX3HBaZtBzcsSZbAMo4pL3dIk7Ax3
5+paSQwvtZ0My4vLMDz+DfEoXKwMxG8hGsZFj+BXbwH6sKuPHbtl6HSNDFJrJPTEvdCXf6nt
LdnrLWosfnK5zjvofKeeDG8mex6dgQepXsbb3EFd7/boPW6YaJnn8PAB1kiHNIZNZSZDehzD
18pdJRwMBg9vgRl0SyGwBNXSpc9wIMQKgq5z8KRkSLBC6JURlu8cHK9gclLbO9faEP78gdNy
/PaF82Z0JODjElhZHvlIjFo7Sbw1L6992DVgGADa6n7q3UgNo6VMiWaI3QyxSrC1PcxzpTUK
7cdt7hIWdbL8xjR8GZR/EcgkmkXs4uPxaKGX32tuQYt2zWVH1QI9KeDS31yBOzdJwVa15nBU
vYvRzvw3rp92/MP5PE1m99S1dW98tIj1Kx3csXG8Vsx2/ZNghVrn1j0a09RDrbbwvVYNs/BY
1IY5Z14xnLIflq3xQGPiaEpnvBDDrfak8qI3AyqjmlMbEf2mqJ+4cRrBZzcXG0bohe0cc2/s
E6Oi9sGOIJTcMq2R9Yx8J7KgKW92T2Bynd7NZlOWrtL5XZqy8gqn84Ldzm7vphWrXNtf/gLa
BAXM/wUAAA==

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

Offline

#153 2019-01-11 11:10:06

douglgm
Member
From: Bristol
Registered: 2006-08-23
Posts: 182
Website

Re: com_connect - form and contact mailer

Thanks Yiannis – that did the trick. I was using an old version. Just need to hope it gets my client off my back now! ;-)

Offline

#154 2019-03-14 19:34:05

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: com_connect - form and contact mailer

Because my client uses Microsoft Exchange on his computer(s) the IT agency wants me to (re)direct outgoing mail via com_connect to a specific SMTP adress: mailgtw01.desktopinacloud.nl … because they are using VPN … :|

Is that possible within the plugin? Textpattern? Any help is welcome … :)

Offline

#155 2019-03-15 22:55:52

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

Re: com_connect - form and contact mailer

RedFox wrote #317055:

the IT agency wants me to (re)direct outgoing mail via com_connect to a specific SMTP adress… Is that possible within the plugin?

Not directly. You’ll need a module that hooks into the comconnect.deliver callback to bypass the internal mail handling and offload it to the nominated endpoint. The good news is that – depending on which library you choose to install (e.g. Pear, PHPMailer, SwiftMailer, msmtp, …) – it’s probably not many lines of code.


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

#156 2019-03-16 07:15:00

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: com_connect - form and contact mailer

Thanks Bloke. And what about e-mails not send via com_connect but via a mailto link? Same libs?

Offline

Board footer

Powered by FluxBB