question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Share plugin support to open email client with To, Subject and Body

See original GitHub issue

I don’t understand how to pre-populate To field of the email client.

content.shareInformation = function (title, text, url, dialogTitle) {
        if (content.isCapacitorMobileApp) {
            Share.share({
                title: title,
                text: text,
                url: url,
                dialogTitle: dialogTitle
            }).then(() => window.console.log("Successful share")).catch((error) => window.console.log("Error sharing", error));
        }
    };

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
stripathixcommented, Oct 16, 2018

It was not working because email account was not configured in the simulator. It works on real device.

All of these options work:

<ul>
        <li><a href="mailto:someone@yoursite.com">Email Us</a> </li>
        <li><a href="mailto:someone@yoursite.com?subject=Mail from Our Site">Email Us</a></li>
        <li>
          <a data-rel="external" id="btnUploadPics" v-on:click="sendmail" data-role="button" data-align="right">Add Photos</a>
        </li>
    </ul>
sendmail() {
            var sLink = "mailto:test@test.com?subject=test";
            //window.open(sLink, "emailWindow");
            window.location.href = sLink;
        }
2reactions
jcesarmobilecommented, Oct 15, 2018

iOS? Android? both? and with a regular anchor tag? or with window.location = ‘mailto…’?

Read more comments on GitHub >

github_iconTop Results From Across the Web

All About mailto: Links | CSS-Tricks
This is somewhat rare to see for some reason, but mailto: links can define the email subject and body content as well.
Read more >
Populate mailto links subject and body with page name
Hello. I am trying to figure out how to add custom subject and body text to an email from a mailto link from...
Read more >
ShareThis: the subject shows up in the To field of an email ...
shows up in the "To" field of the mail client such as desktop Outlook. How can to fix this? The following is the...
Read more >
On-send feature for Outlook add-ins - Office - Microsoft Learn
Provides a way to handle an item or block users from certain actions, and allows an add-in to set certain properties on send....
Read more >
Add a mailto link in an email
Insert a link that opens a new email and pre-fills the email address, subject line, and body content ... A mailto link is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found