flutter_email_js 1.0.2 copy "flutter_email_js: ^1.0.2" to clipboard
flutter_email_js: ^1.0.2 copied to clipboard

A new Flutter Package to integrated Email Js service easily into your flutter project.

EmailJS SDK for Flutter #

Flutter Logo flutter_email_js
Pub Version Pub Points
Pub v1.0.1 100/140

SDK for EmailJS.com services. Login to EmailJS account for sending emails. https://www.emailjs.com/

Demo #

demo_gif

Supports #

Platform Support Android iOS MacOS Web Linux Windows

Features #

FlutterEmailJS enables you to send emails directly from your code with minimal knowledge required. Simply connect FlutterEmailJS to a supported email service, create an email template, and use our SDK to send emails.

Getting started #

Install FlutterEmailJS SDK:

$ flutter pub add flutter_email_js 

Usage #

import 'package:flutter_email_js/flutter_email_js.dart';

Examples #

Map<String, dynamic> templateParams = {
   "user_subject" : "Your subject will be here",
   "user_message" : "Your Message",
   "user_name"    : "Name of Receiver",
   "user_email"   : "Email of receiver",
   "reply_email"  : "Enter the email address where you would like to receive replies from users."
};

try {
  String result = await FlutterEmailJS.sendEmail(
    serviceId:  'YOUR_SERVICE_ID',
    templateId: 'YOUR_TEMPLATE_ID',
    userId: 'USER_ID',
    accessToken : 'ACCESS_TOKEN',
    templateParams,
  );
   print(result);
  
} catch (error) {
  print(error.toString());
}

The provided code defines a Dart class FlutterEmailJS with a static method sendEmail that facilitates sending emails using the EmailJS service. Here’s a detailed explanation of the code:

  • Importing the Package: Imports the flutter_email_js package, which contains the FlutterEmailJS class and its sendEmail method.
  • Static Method: sendEmail is a static method, meaning it can be called without creating an instance of FlutterEmailJS.
  • Parameters: serviceId, templateId, userId, and accessToken are required parameters that must be provided when calling this method.' Template Parameters Map: This map (templateParams) holds the key-value pairs that will be passed to the email template. These parameters are used to dynamically populate the email template with specific values.

Summery #

This code snippet imports the flutter_email_js package and uses it to send an email with dynamic content. It defines the template parameters to customize the email, then calls the sendEmail method with the necessary credentials and parameters. The result of the email-sending operation is printed, and any errors encountered during the process are caught and printed as well.

After you all these configuration, you will receive email like;

email_js

Additional information #

For More Information: Contact to javedmughal609@gmail.com

8
likes
130
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter Package to integrated Email Js service easily into your flutter project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter, http

More

Packages that depend on flutter_email_js