Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
pochta-mjml
Advanced tools
Readme
Pochta is an open source cli application to help developers send test emails. Conventionally you need an email client or some form of API integration. Pochta eliminates that need and helps enhance your email testing workflow.
$ npm i pochta-mjml -g
Below are a few basic examples, run $ pochta help
for more details.
Send an email:
$ pochta send
Create a profile:
$ pochta profiles new
Create an esp:
$ pochta esp new
Create a contact:
$ pochta contacts new
Create an image hosting provider:
$ pochta hosts new
Take a screenshot:
$ pochta capture
Take a screenshot (advanced example):
$ pochta capture -w 320 -w 800 -d 3 -f pdf
If you are using MJML app you can use MailJet integration to test your emails. However, neither your local images get hosted on MailJet server, nor you get an option to embed images as inline attachments or get to host on your preferred CDN directly.
Of course, these limitations can be overcome by exporting html manually and/or updating image sources but, if your assets are constantly changing during the development, then this can be a tedious task.
If you don't have a MailJet account than you're probably relying on Outlook 2010's stationary feature. Outlook is notorious for changing html content and will mess up your layouts in unintended ways.
Pochta eliminates this limitations and you can have multiple CDN and ESP for your need. Additionally, you can build and export your email with a CDN provider for the e-blast distribution.
Pochta also has a built in capture feature which can take screenshots of your email for various devices widths and scale factors.
$ npm install -g pochta-mjml
$ pochta COMMAND
running command...
$ pochta (-v|--version|version)
pochta-mjml/1.1.1 darwin-x64 node-v14.0.0
$ pochta --help [COMMAND]
USAGE
$ pochta COMMAND
...
pochta build
pochta capture
pochta clear ENTITY
pochta connections ACTION
pochta contacts ACTION
pochta esp ACTION
pochta help [COMMAND]
pochta hosts ACTION
pochta profiles ACTION
pochta send
pochta build
Build html/mjml files and export content into a new directory
USAGE
$ pochta build
OPTIONS
-c, --cache=cache Boolean flag to enable/disable upload cache
DESCRIPTION
This command generates HTML by parsing MJML/HTML and hosting images to the dedicated cdn provider. If no host selected
then, either the images can be embedded as Base64 or can be exported to a directory related to the generated html
file.
By default the cache is disabled, meaning on each usage of this command it will try to upload images to the preferred
cdn provider. If you want to enable cache use with --cache=true flag.
See code: src/commands/build.js
pochta capture
Capture html/mjml screenshot and save in various format (i.e. png, jpg, pdf)
USAGE
$ pochta capture
OPTIONS
-d, --dsf=dsf [default: 1] Device Scale Factor. Specifies that the screenshot must be taken at a higher
DPI
-f, --format=jpg|png|pdf [default: png] Screenshot export format
-q, --quality=quality [default: 80] Screenshot quality. Eligible only for if the export format is jpg
-w, --width=width [default: 800] Width of the screenshot. If multiple flags are provided, the command will
export and save screenshots for each width
DESCRIPTION
This command generates a screenshot of the email and saves it under captures directory. In order for this command to
work a Chrome browser must be installed on the machine. The default screenshot width is 800px and will export as a
PNG.
The default width can be overwritten with the width flag. This command supports multiple widths and it is helpful if
you like to capture different sizes. This is extremely helpful for responsive emails or checking email behaviour on
multiple sizes.
If the dfg (Device Scale Factor) flag is set, the screenshots will result as scaled without loosing the quality. Ideal
for mimicking mobile devices screenshots.
Screenshot quality and formats can be changed respectively via quality and format flags.
The screenshot(s) will overwrite any existing files of the same names.
See code: src/commands/capture.js
pochta clear ENTITY
Clears cached settings
USAGE
$ pochta clear ENTITY
ARGUMENTS
ENTITY (cache) [default: cache] Entity you would like to clear
DESCRIPTION
This command will delete all the settings stored in a local directory or globally.
If argument cache is given, it will remove previous user selections and cdn upload cache stored for the current
directory.
See code: src/commands/clear.js
pochta connections ACTION
Create, Read, Update, Delete, Test and Sync connections
USAGE
$ pochta connections ACTION
ARGUMENTS
ACTION (list|new) [default: list] Action for the command
DESCRIPTION
A connection is a form of integration which enhances and/or aids existing functionalities of Pochta. Connections are
built for manipulating root setting or adding features which don't belong to Pochta's core functionalities.
Currently, only Redmine (version 4.0+) connection is supported. Adding this connection will sync contacts and user
profile with your account.
See code: src/commands/connections.js
pochta contacts ACTION
Create, Read, Update and Delete contacts
USAGE
$ pochta contacts ACTION
ARGUMENTS
ACTION (list|new) [default: list] Action for the command
DESCRIPTION
A contact is a form of recipients for supporting multiselect functionality to fill TO or CC fields.
See code: src/commands/contacts.js
pochta esp ACTION
Create, Read, Update, Delete and Test ESP
USAGE
$ pochta esp ACTION
ARGUMENTS
ACTION (list|new) [default: list] Action for the command
DESCRIPTION
ESP or Email Service Providers are required to send out test emails. There are two types of ESP currently supported by
Pochta:
1) SMTP
2) API based
Configurations need to be setup on their dedicated platforms in order to work with Pochta.
See code: src/commands/esp.js
pochta help [COMMAND]
display help for pochta
USAGE
$ pochta help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
pochta hosts ACTION
Create, Read, Update, Delete and Test image hosting providers
USAGE
$ pochta hosts ACTION
ARGUMENTS
ACTION (list|new) [default: list] Action for the command
DESCRIPTION
Configure your CDN provider with Pochta using this command. APIs needs to be enabled on the dedicated platforms in
order to work with Pochta.
See code: src/commands/hosts.js
pochta profiles ACTION
Create, Read, Update and Delete profiles
USAGE
$ pochta profiles ACTION
ARGUMENTS
ACTION (list|new) [default: list] Action for the command
DESCRIPTION
A profile is a contact which is displayed as an identification when sending out emails. This helps enable
functionalities to auto include as cc or reply to.
See code: src/commands/profiles.js
pochta send
Build, export and send HTML/MJML files as test emails with attachments
USAGE
$ pochta send
OPTIONS
-c, --cache=cache Boolean flag to enable/disable upload cache
DESCRIPTION
This command will provide a guide and selection process for sending out test emails. You can add additional
attachments from the current directory with the email.
Subject line is derived from html's <title> tag. If the tag is missing Pochta will set a default value.
An Image hosting provider is not necessary since Pochta can embed images inline or as attachments.
Currently supported attachment types are: 'jpg', 'jpeg', 'png', 'webp', 'gif', 'svg', 'pdf', 'mp4', 'webm', 'mov',
'zip', 'txt'
See code: src/commands/send.js
FAQs
Testing MJML/HTML emails simplified. A serverless cli application solution for multiple integrations.
The npm package pochta-mjml receives a total of 0 weekly downloads. As such, pochta-mjml popularity was classified as not popular.
We found that pochta-mjml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.