Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anybody who succeeded in adding "Email Composer" Cordova plugin to Ionic 5 project (for Android12)?

I have created a simple Ionic 5 app and would like to add the functionality that would allow sending emails (including those scheduled). I have tried the https://ionicframework.com/docs/native/email-composer but found myself stuck with this supporting Android 12. Is there anybody who succeeded?

like image 986
Dreamer Avatar asked Nov 23 '25 23:11

Dreamer


2 Answers

I am use Appery.io to do that, they are based on Cordova and I have no issues with their Ionic 5 app working on Android 12 devices.They offer https://docs.appery.io/docs/ionic-5-mailgun-email-sample-app-with-server-code-plugin, https://docs.appery.io/docs/ionic-5-sendgrid-email-sample-app-with-server-code-plugin. They also offer to try bulk mailing using their SendGridEmail plugin: https://docs.appery.io/docs/using-sendgrid-plugin-for-bulk-mailing.

like image 61
BangaloreJack Avatar answered Nov 28 '25 07:11

BangaloreJack


After searching around for a while, I came across Simon Grimm's video in which he added this exact plugin to an Ionic/Capacitor project. Prior to finding the video I was having trouble figuring out how to add the Android configuration properly to AndroidManifest.xml. When running ionic cap sync, I got a warning that I needed to add the following to AndroidManifest.xml:

<intent>
  <action android:name="android.intent.action.SENDTO"/>
  <data android:scheme="mailto"/>
</intent>

But there was no documentation on how exactly to do this. The solution was in the video:

<manifest ...>

    <queries>
        <intent>
            <action android:name="android.intent.action.SENDTO"/>
            <data android:scheme="mailto"/>
        </intent>
    </queries>

</manifest>

The intent element needs to be placed inside <queries>, which should be placed directly within the <manifest> tag (and not inside <application> or <activity>). After doing this, I was able to get the email composer to open up on Android 12 with Gmail.

Reference: https://www.youtube.com/watch?v=AF0jnmbbpbE

like image 26
angus Avatar answered Nov 28 '25 07:11

angus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!