feat(smtp-client): add plugin (#4585)

* smtp-client

* fix plugin ref

* cloud settings

---------

Co-authored-by: Daniel Sogl <daniel@sogls.de>
This commit is contained in:
marysuon 2023-07-11 19:27:06 +02:00 committed by GitHub
parent 126d44faf3
commit 2b6c297da8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 110 additions and 2 deletions

View File

@ -217,6 +217,7 @@
* [Browser Tab](plugins/browser-tab.md)
* [Dynamsoft Barcode Scanner](plugins/dynamsoft-barcode-scanner.md)
* [GCDWebServer](plugins/gcdwebserver.md)
* [Smtp Client](plugins/smtp-client.md)
* [Cashfree PG](plugins/cashfree-pg/README.md)
* [Installation](installation.md)
* [FAQ](faq.md)

View File

@ -0,0 +1,16 @@
# Smtp Client
```text
$ ionic cordova plugin add cordova-plugin-smtp-client
$ npm install @awesome-cordova-plugins/smtp-client
```
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/smtp-client/)
Plugin Repo: [https://github.com/CWBudde/cordova-plugin-smtp-client](https://github.com/CWBudde/cordova-plugin-smtp-client)
## Supported platforms
* Android
* iOS

View File

@ -0,0 +1,20 @@
# Smtp Client
```
$ ionic cordova plugin add cordova-plugin-smtp-client
$ npm install @awesome-cordova-plugins/smtp-client
```
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/smtp-client/)
Plugin Repo: [https://github.com/CWBudde/cordova-plugin-smtp-client](https://github.com/CWBudde/cordova-plugin-smtp-client)
## Supported platforms
- Android
- iOS

View File

@ -29,10 +29,11 @@ import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-pl
*/
@Plugin({
pluginName: 'CloudSettings',
plugin: 'cordova-plugin-cloud-settings',
plugin: '@marysuon/cordova-plugin-cloud-settings',
pluginRef: 'cordova.plugin.cloudsettings',
repo: 'https://github.com/dpa99c/cordova-plugin-cloud-settings',
install: 'ionic cordova plugin add cordova-plugin-cloud-settings --variable ANDROID_BACKUP_SERVICE_KEY=myapikey',
install:
'ionic cordova plugin add @marysuon/cordova-plugin-cloud-settings --variable ANDROID_BACKUP_SERVICE_KEY=myapikey',
installVariables: ['ANDROID_BACKUP_SERVICE_KEY'],
platforms: ['Android', 'iOS'],
})

View File

@ -0,0 +1,70 @@
import { Injectable } from '@angular/core';
import { Cordova, AwesomeCordovaNativePlugin, Plugin } from '@awesome-cordova-plugins/core';
/**
* @name Smtp Client
* @description
* @usage
* ```typescript
* import { SmtpClient } from '@awesome-cordova-plugins/smtp-client/ngx';
*
* constructor(private smtpClient: SmtpClient) { }
*
* ...
*
* this.smtpClient.sendMail(mailSettings, success, failure);
*
* ```
*/
@Plugin({
pluginName: 'SMTPClient',
plugin: 'cordova-plugin-smtp-client',
pluginRef: 'smtpClient',
repo: 'https://github.com/CWBudde/cordova-plugin-smtp-client',
install: 'ionic cordova plugin add cordova-plugin-smtp-client',
platforms: ['Android', 'iOS'],
})
@Injectable()
export class SmtpClient extends AwesomeCordovaNativePlugin {
/**
* The sendMail function.
*
* var mailSettings = {
* emailFrom: "emailFrom@domain.com",
* emailTo: "emailTo@domain.com",
* smtp: "smtp-mail.domain.com",
* smtpUserName: "authuser@domain.com",
* smtpPassword: "password",
* attachments: ["attachment1", "attachment2"],
* subject: "email subject",
* textBody: "write something within the body of the email"
* };
*
* var successCallback = function(message) {
* alert(message);
* }
*
* var errorCallback = function(message) {
* alert("Error sending the email");
* }
*
* @param mailSettings
* @param successCallback
* @param errorCallback
* @returns {Promise<any>}
*/
@Cordova()
sendMail(mailSettings: any, successCallback: any, errorCallback: any): Promise<any> {
return;
}
/**
* You can call isLoaded to check if client is loaded.
*
* @returns {Promise<any>}
*/
@Cordova()
isLoaded(): Promise<any> {
return;
}
}