Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dibs-tech/mail-client

Package Overview
Dependencies
Maintainers
4
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dibs-tech/mail-client - npm Package Compare versions

Comparing version 1.7.1 to 1.8.0

helpers/getDibsPhoneNumber.js

38

index.js

@@ -7,2 +7,3 @@ const SparkPost = require('sparkpost');

const isURL = require('./helpers/validators/isURL');
const getPhoneNumberFromCurrency = require('./helpers/getDibsPhoneNumber');

@@ -184,5 +185,42 @@ require('./helpers/handlebars/classOrClasses')(handlebars);

/**
*
* @param {Object} studio object to generate email data for
* @param {string} emailType of email
* @returns {Object} data object for email
*/
MailClient.prototype.getEmailDataForStudio = function getEmailDataForStudio(studio, emailType) {
const phone = {
text: getPhoneNumberFromCurrency(studio.currency),
href: getPhoneNumberFromCurrency(studio.currency, { href: true }),
};
let template = `white-label/${emailType}`;
if (studio.custom_email_template) {
switch (emailType) {
case 'confirmation':
default:
template = studio.custom_email_template.confirmation.link;
}
}
const domain = studio.customSendingDomain || 'no-reply@ondibs.com';
const customEmailText = (studio.custom_email_text.find(cet => cet.template === emailType) &&
studio.custom_email_text.find(cet => cet.template === emailType).text) || '';
const purchasePlaceLink = studio.live && !studio.liveWidget ? 'https://www.ondibs.com/users' : `http://${studio.domain}?dibs_open`;
return {
studio,
studioName: studio.name,
template,
customEmailText,
domain,
purchasePlaceLink,
phone,
};
};
MailClient.prototype.transactions = function transactions(subject, message, options, cb) {
this.sendEmail('transactions@ondibs.com', subject, message, options, cb);
};
/**

@@ -189,0 +227,0 @@ *

2

package.json
{
"name": "@dibs-tech/mail-client",
"version": "1.7.1",
"version": "1.8.0",
"description": "A mail client implementation, using sparkpost",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc