mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:23:10 +08:00
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:
parent
126d44faf3
commit
2b6c297da8
@ -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)
|
||||
|
16
docs/plugins/smtp-client.md
Normal file
16
docs/plugins/smtp-client.md
Normal 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
|
||||
|
20
docs/plugins/smtp-client/README.md
Normal file
20
docs/plugins/smtp-client/README.md
Normal 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
|
||||
|
||||
|
||||
|
@ -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'],
|
||||
})
|
||||
|
70
src/@awesome-cordova-plugins/plugins/smtp-client/index.ts
Normal file
70
src/@awesome-cordova-plugins/plugins/smtp-client/index.ts
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user