foundry376 / mailspring-plugin-starter Goto Github PK
View Code? Open in Web Editor NEWA template for kicking off your very own Mailspring plugin!
A template for kicking off your very own Mailspring plugin!
Problem
node_modules
are required for plugin execution
Solution
node_modules
from .gitignoreI'm trying to create a plugin which get all images using data url (<img="data:..." />) into attachments because gmail does not read image in data url format.
As the signature settings don't allow to attach files to the message in order to render them without the use of an external url, the goal is to create signature with image as data url and then intercept the message before it's being sent to convert these image to images like <img src="cid:${attachment.cid}">
to allow all email clients to read them properly. The same way Evolution currently does on linux.
I've been able to create the plugin but I am stuck in the process of attaching the file. I did not find in the documentation how we are supposed to create an attachment to the mail in the applyTransformsForSendng method.
import { ComposerExtension, File } from 'mailspring-exports';
export default class ReplaceBase64Extension extends ComposerExtension {
static applyTransformsForSending({ draftBodyRootNode, draft, recipient }) {
// code pour intercepté le mail, regarder toutes les images qui utilisent une url en base64
// et remplacer par des fichiers en pièce jointe
// ...
console.log("[BASE64]", "will intercept message", { draftBodyRootNode, draft, recipient })
let body = draftBodyRootNode.innerHTML;
let matches = body.match(/<img[^>]*src="data:image\/(.*);base64,([^"]*)"[^>]*>/g);
if (!matches) {
return;
}
matches.forEach(match => {
let data = match.match(/src="data:image\/(.*);base64,([^"]*)"/);
console.log("Attachments to add...", data);
let type = data[1];
let base64 = data[2];
/****** Part which is not working
let attachment = File.fromBase64(base64, `image.${type}`);
draft.attachments.push(attachment);
*******/
body = body.replace(match, `<img src="cid:${attachment.cid}">`);
});
draftBodyRootNode.innerHTML = body;
console.log("Replaced body", body);
}
}
Is there any solution for a plugin to dynamically create an attachment?
I have sent a few emails to [email protected] regarding my pro billing - it has been read but no one replies? How can I get a hold of a billing support person at Mailspring?
I have been billed every month 7.99 twice on my discover and then 7,99 on my visa, for several months because I had to open new accounts because I couldn't get on and I email tech and no response. My 2 email are [email protected] and [email protected]. I would like to get a credit for the months that I have been paying and triple for one account because the service didn't work and I tried tech support and no response and I could see they never pick up the msg.
Please get back with me
Dawn Penuel
I must say Grammarly has become an essential part of my life. I love mailspring, but it has no integration with Grammarly. I will pay someone to create a Grammarly integration for myself and others to use. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.