Giter Site home page Giter Site logo

mailspring-plugin-starter's People

Contributors

bengotow avatar sergeystoma avatar striffly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mailspring-plugin-starter's Issues

node_modules are required

Problem
node_modules are required for plugin execution

Solution

  • Remove node_modules from .gitignore
  • Build typescript with webpack

Write a plugin which creates attachment

I'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?

billing

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

[Request] Grammarly Plugin

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.