Submitting form using mailto - android

I am having an issue submitting with my form which I have built using jquery mobile and uploaded onto my android tablet using Phonegap build.
The script I am using is
<script>
function formSubmit()
{
document.getElementById("SiteVisit").action ="mailto:pja#bresnan.net?cc=" + document.getElementById("COC_Received_By").value + "&subject=Site%20Visit%20Form";
document.getElementById("SiteVisit").submit();
}
</script>
<form method="post" enctype="text/plain" name="SiteVisit" id="SiteVisit">
I keep getting an Application Error that "The Protocol isn't Supported"
I am not real code savvy...can someone please help me out with this one

I don't think you can just submit a form like this. Usually, on a normal web browser, you can't - you need the browser to be configured to use email. This is likely a browser configuration issue.
If you want things sent by email you can use one of the email plugins for PGB.
You set up your form to send its information to the email program. There are two ways to do it - 1. the user fills in a form and when they click Send all the info is sent to the email app and the user has to click Send again. 2. You just have the email option.
I use version 1 because, as it's a form, you can have the email pre-populated with the options from the Form. E.g. If you have a star rating you can pass the value from the form to the email. The heading of the email, for example, would be "Service Rating 5/5" or "Service Rating 3/5". Iyswim.

Related

Customize Firebase Reset email content

I am using Firebase in my app and one of the things that I added recently was the option to send a reset password link.
When the user receives the email it looks as follows:
Is there any option to read certain data from my Firebase firestore and display it in the email?
For example, when user1 registered to the app he needed to set an email and a username (say: user1_cool). Now, when user1 sent himself a reset link I had like it to show:
Hello user1_cool,
...
From this link, it seems impossible but still was wondering if someone found a way.
Right now my email is as follows:
<p>Hello %DISPLAY_NAME%,</p>
<p>Follow this link to reset your password for your %EMAIL% account.</p>
<p><a href='%LINK%'>%LINK%</a></p>
<p>If you didn’t ask to reset your password, you can ignore this email.</p>
<p>Thanks,</p>
<p>NeighborBook team</p>
Thank you
Well, as far as I know,
Is there any option to read certain data from my Firebase firestore
and display it in the email?
No, Currently there is no possibility of that in firebase ...
But since you mentioned about user setting a user name I am writing an alternative for this
If you want to show user name in %DISPLAY_NAME% you can modify user display name like this if you want
UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()
.setDisplayName("Custom User Name Goes Here")
.build();
This will modify user display name and when you use the same template for the email the username set by the user will be sent instead of usual display name
Note: This is recommended and should be only used in this
specific case
For more info visit : UserProfileChangeRequest.Builder
You can only change a few things about the emails that Firebase sends, as otherwise this functionality could be abused to deliver irrelevant content.
If you want full control over the emails that are sent, you'll need to implement your own email delivery. You can still use Firebase Authentication's handler for the links in that email, but following the documentation on customizing the email handler.

Can I send mail without opening mail app using IONIC in both Android and IOS?

I want to send mail on click of a button without opening mail application using IONIC only. Is this possible in IOS and ANDROID? I have used email composer but it opens mail application.
So the logic here is that it would be actually pretty bad (for users) if mobile apps / web-apps would gain ability to send emails without user's explicit action to do so. Think of spam bot networks that would emerge etc.
You have 2 options:
create your own server side logic (API) that clients call to and
perform email action via an "email as a service".
help user to open email client with "pre-filled" email details
For #1 you can use sendgrid.com and similar services, so that your own service could call sendgrid and dispatch emails/
For #2 there are simple web techniques (not ideal though) like so:
submitIdea() {
let formattedBody = `Hi, here is my idea...: \n \n \n`;
window.location.href = `mailto:ideas#yourdomain.com?subject=Idea for web app from ${this.foundation.userData.user.nickname}&body=`+encodeURIComponent(formattedBody);
this.foundation.analytics.track("idea", "user clicked submit button");
};
This will open app default email client and will help user to type less of text or supply certain app details automatically.
I used this to help with user support / feedback type of emails, where app version etc context can be auto populated.

Android open email client with html content in cordova

I am making application in ionic and one of it's functionality to send mail so i have used plugin
problem is i am not able to generate link for android with gmail version > 6.10
Also tried to send mail using apps Gmail, Outlook, Bluemail every mail client giving different output.
Gmail version 6.10(ok) but 6.11(not generating links)
Outlook giving blank result (not event text as other mail client gives)
Bluemail same as Gmail
I'll be thankful if you have any solution of this.
EDIT
Sorry if you misunderstood "generate link" means using html content(<a href="...">)
Was using the plugin myself also, lots of problems and poorly maintained, just check their Github issues page to confirm, use this instead and you can specify to send via email using .shareViaEmail and include link in there.
Use var bodyText = document.getElementById("aaa").href; to get value for link, surely you must have <div><a href=‘YOURLINK’ id='aaa'>texthere</a></div> in HTML. Then pass it as as a message .shareViaEmail("PASS IT HERE",

Email dialog HTML ignores some tags Titanium Moblie

I'm currently building an app that has Email sending capabilities. I'm trying to send an Email with the relevant information and includes a link to the original post that is being sent. the original post is created as an HTML code segment, so I have to send the Email as an HTML. i create the Email dialog like this:
var mail = Ti.UI.createEmailDialog({
subject:'FW:'+post.desc,
html:true,
messageBody: '<br><br>view original post<br><br><b style="font-size:1.5em;font-family:Arial">'+post.desc+'</b><br><br><i>'+metaData.text.toString().replace(/\n/g,'<br>')+' </i><br><br>'+post.htmlData
});
Ti.API.debug(mail.messageBody)
mail.open();
when I ran the app on my device, I got the option of sending via "mail" or via "Gmail". when sent via "mail", all the link tabs and and were ignored and striped so the Email didn't include them. however, the "Gmail" option left everything as suppose to.
any thoughts?
the question was asked also in Titanium Q&A
Apparently, the default Email client for Android doesn't have a HTML renderer and disregards it, and the Gmail Android client won't parse certain tags like .
it seems to me like the answer will be using temporary files and attachments.
if anybody comes up with a better answer I'll be very happy.
happy X-mas | Hanukah | festivus for the rest of us

MAILTO Link in email to start a new email

I have a contact form on a website for customers to contact my company. Upon completing this form a correspondence is sent to the appropriate sales associate for that region. In this email it captures the information provided in the contact form the customer provided. More often than not the customer is requesting more information than what is available on our website.
I would like to include a MAILTO link in the email sent to the sales associate that would allow them a one click option to send additional documents/information/webpages not open to public traffic to customers requesting the information. Something along the lines of:
<a href="mailto:customer#email.com&subject=Information
Requested&body=Here's more information.
http://www.website.com/info/info.pdf">Send More Info</a>
I've tested this link and found it works perfectly in Outlook, Thunderbird and even GMail. But on mobile devices such as Android, iPhone or iPad the entire portion of the MAILTO string is put in the recipient line. I've tried URL encoding the link to something like:
<a href="mailto:customer#email.com&subject=Information
Requested&body=Here's more information.%0A%0A
http:%3A%2F%2Fwww.website.com%2Finfo%2Finfo.pdf">Send More Info</a>
But this doesn't seem to change anything at all as the desired result is still not achieved. The second link still works properly in other email client just not mobile devices. My searching has led me to only find articles about creating the MAILTO link in code specific for Android or iOS devices.
Any way to make this solution work in a normal email or webpage? Thanks!
Monday morning mistake on a Friday.
<a href="mailto:customer#email.com?subject=Information
Requested&body=Here's more information.
http://www.website.com/info/info.pdf">Send More Info</a>
Note the change of the question mark before the subject instead of an ampersand.
Yes, it's the ampersand. This works when using desktop email but when you switch to a mobile device it just causes it to be dumped into the "to:" line. Changing the ampersand to a question mark will make it work in both desktop and mobile environments.

Categories

Resources