How to send personalized links in a mail? - html

I'm setting up a solution for a backoffice website where the user should be able to send mail for some technician.
In this mail, the technician must be able to click on a specific button and this will open a new web page with adaptative parameters such as the date, the address, the client name, etc..
To do so, I need to send at least one parameter in the mail (the mission id of this technician) and this parameter must be different in each mail.
I already tried a solution in which the mail is written in HTML and then I could insert a form in the body or a link for a GET request. But it seems that not all the mail server can handle this way of work.
In Gmail it works for everything, but using Safari for Mac OS X, or Outlook messenger it doesn't.
Using POST:
<form action='__the_website_to_post_request__' method='post'>
<input name='id' type='hidden' value='$id'>
<button type='submit' formmethod='post'>Upload reports</button>
</form>
Using GET:
<a href='__the_website_to_post_request__?id=".$id."&tok=".md5($id)."'>
Upload reports
</a>
In Outlook, no button appears and in Safari, the post method doesn't work.
Maybe another solution exist doesn't matter which mail application I should use ?

Related

How to send email with form submission on Netlify?

I am making a website for a restaurant and I want to make a reservation form where people would enter their name, time of reservation, etc. And when they submit this form I want to send an email to my email.
I know there is a service called Zapier which gives you the ability to do that, but I am looking for something free (in this case Zapier free tier has only 100 tasks per month which may not be enough).
I would want it to look something like this:
<form>
<input type="text" placeholder="Your name" />
<!-- and some other inputs -->
<input type="submit" value="Send" />
<!-- after this send an email with entered information -->
</form>
If you're hosting your site on Netlify you can use their feature "Netlify forms" which is free and easy to integrate (just add a custom "netlify" attribute to your HTML form element). Here are their docs:https://docs.netlify.com/forms/setup/#html-forms
Netlify also helps you with spam/robot protection before (e.g. via a so called "honeypot" field) and after submit (e.g. via a tool called "akismet").
Then you can set up email notifications, which will send you the data of the submitted form to your email inbox of choice. Here are their docs: https://docs.netlify.com/forms/notifications/
Instead of using Netlify or Zapier, you might just want to use getsimpleform.com as the form endpoint. As far as I know, the service is free and sends you an email on form submission.

Objective C - Launch app after tapping link on email

im trying to launch my app when user taps on link on email .. i've seen many posts like this but i can't seem to get it to work .. there's a problem i've been encountering, if the link i send is https://www.google.com (or any other valid websites), when i tap on the link, it works. It launches safari then goes to the site.. but if i replace it with my urlScheme, the body in the email appears to be not read as a link .. by the way.. im creating the email message in the client side .. here is sample code..
Nsstring *htmlBodyWebsite = #“<a href=\”https://www.google.com\”>Click here</a>" < working
Nsstring *htmlBodyUrlScheme = #“<a href=\”myApp://\”>Click here</a>" <not working
// when i enter in safari browser - myApp:// << working
so it seems that i've setup urlscheme correctly since when i entered myApp:// in safari, it prompted me to launch my app.
so the process here is, i create the email message in the client side... then our server receives it and sends it via email to target recipient..
now when the recipient receives the email, here are some observations i've made..
when i send htmlBodyWebsite, it works fine. Using google chrome browser and in the email message itself, when i right click, then inspect, i would be able to find the referenced link with proper tagging
but with htmlBodyUrlScheme it doesn't have proper html tagging
thanks
it seems to work if i tap on the link using the ios built-in Mail app.. neither using safari to open gmail.com nor gmail app doesnt make it resolve this issue..

What happens when submitting an html form? (the process behind the scenes)

Can someone please tell me what happens behind the scenes in the following case (i.e. explain the whole technical process)?
<form method="get" action="#">
<input type="text" name="d" value="flowers">
<button type="submit">send</button>
</form>
In this case after one has clicks on “send” a new webpage opens saying: "You have searched for "flowers" " and an image of some flowers below.
In the browser tab right after the URL of the newly opened page there is
“/?s=flowers”. What is that?
Thank you in advance for your answers!
When you click Send, the page data specified in the form information and values is passed to the server via HTTP.
The /?s=flowers is the GET data being passed back to the server. Although, based on the form code you've provided, the "name" of that value is d. So the URL would actually have /?d=flowers
The PHP or server side language then handles that information to do specific tasks. It can access the info using the name "d". This method of sending data is called GET, there are also other ways of doing this. The most common, POST, does not display the data in the URL and send the data through HTTP headers.
The code you've shown has an action of "#" which means the HTTP method is being sent the same page. Meaning this page code would have some PHP located in it. This can also be done by using a seperate file, such as action='send.php'

Submit to HttpHandler results in RequestType GET instead of POST

My ActionHandler.ashx file should be POSTed yet upon entry to ProcessRequest the context.Request.RequestType is always "GET".
Background:
This HttpHandler currently works OK (i.e. clicking a link in an email causes my ActionHandler.ashx to be entered and the querystring is processed correctly). For example:
https://mdwdata/CorporateBrain/ActionHandler.ashx?Action=MarkComplete&ID=1024~nzmewoojgnn&CUID=13
is the URL for the link shown as Mark-Complete in the image just below:
But now I am trying to improve it by following this advice in a previous SO thread :
"In the body of the email, instead of sending a link, include an HTML form that contains a button which performs a postback to your server."
Problem Summary: When I click the Submit button, my handler is entered with verb GET not POST (hence, I have no access to the hidden form data in the Request.Form collection.
Here is a snippet (image) of the email body
If I can get the Submit to post the hidden form variables to my handler, then of course I would remove the links. In the debugger, I verified the form data and it looks good me:
I added this line to my web.config file:
<add path="ActionHandler.ashx" verb="GET,POST" type="System.Web.UI.SimpleHandlerFactory" validate="true" />
Also, my email client is Thunderbird.
What would cause the request to be GET instead of POST?
The short answer to this problem is that Thunderbird does not POST to the URL in the Action attribute of the HTML form tag. Even the newest version of Thunderbird (version 31.2.0) "ignores" the POST and requests the URL via GET.
The construction of the HTML form is properly done and other email clients I have tested work fine:
Microsoft Office 365 Outlook Web App
Google GMail
So, I guess I am doing it "right" but some email clients apparently don't support this (even my favorite which is Thunderbird).

Sending html form controls in email through sqlserver

I am trying to send an email, from sqlserver, that has html form elements like textfields and buttons.
Here is my script
Declare #Body varchar(max)
set #Body = '<html>
<body>
<form action="http://localhost:8080/Email_test/TestServlet.do" method="post">
<input type="text" name="test_input" id="test_input" value=""/>
<input type="submit" value="update"/>
</form>
</body>
</html>
'
exec sp_send_dbmail
#profile_name = 'test_profile',
#recipients='me#example.com',
#subject = 'This is a test form',
#body = #Body,
#body_format = 'HTML';
The above script works fine and sends an email to the intended recipient with one problem.
The form elements are not present in the mail and a message is displayed at the very top of the mail that says "if the message of this mail is not displayed properly click here to open it in a web browser".
I am using microsoft outlook 2010.
Is there a way to make these form elements render in the mail itself, instead of going to the browser..?
The HTML form tag is not supported in Outlook from 2007, including in Outlook 2010. Its considered a security risk.
Actually its not a SQL-Server issue, its a email client issue. As you can see in the image below, lots of clients don't support the form tag.
image from this url: http://css-tricks.com/html-forms-in-html-emails/
After some research, it is evident that outlook mail client doesn't support the form tags and other elements like a button or textbox. But the form element and other input elements work when you use the online version of outlook OWA.
But in OWA also scripts won't get executed. In the desktop version, there will be an option to view the message in the web browser, which will render everything fine just like a web page.
As pointed out by others, there appears to be some serious levels of security issues. For instance, there is no way to authenticate if the form is submitted by the intended recipient. Anybody with access to the html code can just fill it and submit it as there is no method to authenticate the submitter.
Microsoft Infopath or outlook's custom forms can be used for this purpose.