Code Monkey home page Code Monkey logo

emailerooo's Introduction

eMailerOOo logo Documentation

Ce document en français.

The use of this software subjects you to our Terms Of Use and Data Protection Policy.

version 1.2.1

Introduction:

eMailerOOo is part of a Suite of LibreOffice and/or OpenOffice extensions allowing to offer you innovative services in these office suites.

This extension allows you to send documents in LibreOffice as an email, possibly by mail merge, to your telephone contacts.

It also provides an API allowing you to send emails in BASIC and supporting the most advanced technologies: OAuth2 protocol, Mozilla IspDB, HTTP instead of SMTP/IMAP for Google servers... A macro SendEmail for sending emails is provided as an example.
If you open a document beforehand, you can launch it by:
Tools -> Macros -> Run Macro... -> My Macros -> eMailerOOo -> SendEmail -> Main -> Run

Being free software I encourage you:

  • To duplicate its source code.
  • To make changes, corrections, improvements.
  • To open issue if needed.

In short, to participate in the development of this extension.
Because it is together that we can make Free Software smarter.


Requirement:

The eMailerOOo extension uses the OAuth2OOo extension to work.
It must therefore meet the requirement of the OAuth2OOo extension.

The eMailerOOo extension uses the jdbcDriverOOo extension to work.
It must therefore meet the requirement of the jdbcDriverOOo extension.

On Linux and macOS the Python packages used by the extension, if already installed, may come from the system and therefore may not be up to date.
To ensure that your Python packages are up to date it is recommended to use the System Info option in the extension Options accessible by:
Tools -> Options -> Internet -> eMailerOOo -> View log -> System Info
If outdated packages appear, you can update them with the command:
pip install --upgrade <package-name>

For more information see: What has been done for version 1.2.0.


Installation:

It seems important that the file was not renamed when it was downloaded.
If necessary, rename it before installing it.

  • OAuth2OOo logo Install OAuth2OOo.oxt extension Version

    You must first install this extension, if it is not already installed.

  • jdbcDriverOOo logo Install jdbcDriverOOo.oxt extension Version

    This extension is necessary to use HsqlDB version 2.7.2 with all its features.

  • If you don't have a datasource, you can:

    • vCardOOo logo Install vCardOOo.oxt extension Version

      This extension is only necessary if you want to use your contacts present on a Nextcloud platform as a data source for mailing lists and document merging.

    • gContactOOo logo Install gContactOOo.oxt extension Version

      This extension is only needed if you want to use your personal phone contacts (Android contact) as a data source for mailing lists and document merging.

    • mContactOOo logo Install mContactOOo.oxt extension Version

      This extension is only needed if you want to use your Microsoft Outlook contacts as a data source for mailing lists and document merging.

  • eMailerOOo logo Install eMailerOOo.oxt extension Version

Restart LibreOffice after installation.
Be careful, restarting LibreOffice may not be enough.

  • On Windows to ensure that LibreOffice restarts correctly, use Windows Task Manager to verify that no LibreOffice services are visible after LibreOffice shuts down (and kill it if so).
  • Under Linux or macOS you can also ensure that LibreOffice restarts correctly, by launching it from a terminal with the command soffice and using the key combination Ctrl + C if after stopping LibreOffice, the terminal is not active (no command prompt).

Use:

Introduction:

To be able to use the email merge feature using mailing lists, it is necessary to have a datasource with tables having the following columns:

  • One or more email addresses columns. These columns are chosen from a list and if this choice is not unique, then the first non-null email address column will be used.
  • One or more primary key column to uniquely identify records, it can be a compound primary key. Supported types are VARCHAR and/or INTEGER, or derived. These columns must be declared with the NOT NULL constraint.

In addition, this datasource must have at least one main table, including all the records that can be used during the email merge.

If you do not have such a datasource then I invite you to install one of the following extensions:

  • vCardOOo. This extension will allow you to use your contacts present on a Nextcloud platform as a data source.
  • gContactOOo. This extension will allow you to use your Android phone (your phone contacts) as a datasource.
  • mContactOOo. This extension will allow you to use your Microsoft Outlook contacts as a datasource.

For these 3 extensions the name of the main table can be found (and even changed before any connection) in:
Tools -> Options -> Internet -> Extension name -> Main table name

This mode of use is made up of 3 sections:

Merge emails with mailing lists:

Requirement:

To be able to post emails to a mailing list, you must:

  • Have a datasource as described in the previous introduction.
  • Open a new document in LibreOffice / OpenOffice Writer.

This Writer document can include merge fields (insertable by the command: Insert -> Field -> More fields -> Database -> Mail merge fields), this is even necessary if you want to be able to customize the content of the email and any attached files.
These merge fields should only refer to the main table of the datasource.

If you want to use an existing Writer document, you must also ensure that the datasource and the main table are attached to the document in: Tools -> Address Book Source.

If these recommendations are not followed then merging of documents will not work and this silently.

Starting the mail merge wizard:

In LibreOffice / OpenOffice Writer document go to: Tools -> Add-Ons -> Sending emails -> Merge a document

eMailerOOo Merger screenshot 1

Data source selection:

The datasource load for the Email merging wizard should appear:

eMailerOOo Merger screenshot 2

The following screenshots use the gContactOOo extension as the datasource. If you are using your own datasource, it is necessary to adapt the settings in relation to it.

In the following screenshot, we can see that the datasource gContactOOo is called: Addresses and that in the list of tables the table: PUBLIC.All my contacts is selected.

eMailerOOo Merger screenshot 3

If no mailing list exists, you need to create one, by entering its name and validating with: ENTER or the Add button.

Make sure when creating the mailing list that the main table is always selected in the list of tables.
If this recommendation is not followed then merging of documents will not work and this silently.

eMailerOOo Merger screenshot 4

Now that your new mailing list is available in the list, you need to select it.

And add the following columns:

  • Primary key column: Uri
  • Email address columns: HomeEmail, WorkEmail and OtherEmail

If several columns of email addresses are selected, then the order becomes relevant since the email will be sent to the first available address.
In addition, on Recipients selection step of the wizard, in the Available recipients tab, only records with at least one email address column entered will be listed.
So make sure you have an address book with at least one of the email address field (Home, Work or Other) entered.

eMailerOOo Merger screenshot 5

This setting is to be made only for new mailing lists.
You can now proceed to the next step.

Recipients selection:

Available recipients:

The recipients are selected using 2 buttons Add all and Add allowing respectively:

  • Either add the group of recipients selected from the Address book list. This allows during a mailing, that the modifications of the contents of the group are taken into account. A mailing list only accepts one group.
  • Either add the selection, which can be multiple using the CTRL key. This selection is immutable regardless of the modification of the address book groups.

eMailerOOo Merger screenshot 6

Example of multiple selection:

eMailerOOo Merger screenshot 7

Selected recipients:

The recipients are deselected using 2 buttons Remove all and Remove allowing respectively:

  • Either remove the group that has been assigned to this mailing list. This is necessary in order to be able to edit the content of this mailing list again.
  • Either remove the selection, which can be multiple using the CTRL key.

eMailerOOo Merger screenshot 8

If you have selected at least 1 recipient, you can proceed to the next step.

Sending options selection:

If this is not already done, you must create a new sender using the Add button.

eMailerOOo Merger screenshot 9

The creation of the new sender is described in the Configure connection section.

The email must have a subject. It can be saved in the Writer document.
You can insert merge fields in the email subject. A merge field is composed of an opening brace, the name of the referenced column (case sensitive) and a closing brace (ie: {ColumnName}).

eMailerOOo Merger screenshot 10

The email may optionally have attached files. They can be saved in the Writer document.
The following screenshot shows 1 attached file which will be merged on the data source then converted to PDF format before being attached to the email.

eMailerOOo Merger screenshot 11

Make sure to always exit the wizard with the Finish button to confirm submitting the send jobs.
To submit mailing jobs, please follow the section Outgoing emails.

Configure connection:

Starting the connection wizard:

In LibreOffice / OpenOffice go to: Tools -> Add-Ons -> Sending emails -> Configure connection

eMailerOOo Ispdb screenshot 1

Account selection:

eMailerOOo Ispdb screenshot 2

Find the configuration:

eMailerOOo Ispdb screenshot 3

SMTP configuration:

eMailerOOo Ispdb screenshot 4

IMAP configuration:

eMailerOOo Ispdb screenshot 5

Connection test:

eMailerOOo Ispdb screenshot 6

Always exit the wizard with the Finish button to save the connection settings.

Outgoing emails:

Starting the email spooler:

In LibreOffice / OpenOffice go to: Tools -> Add-Ons -> Sending emails -> Outgoing emails

eMailerOOo Spooler screenshot 1

List of outgoing emails:

Each send job has 3 different states:

  • State 0: the email is ready for sending.
  • State 1: the email was sent successfully.
  • State 2: An error occurred while sending the email. You can view the error message in the Spooler activity log.

eMailerOOo Spooler screenshot 2

The email spooler is stopped by default. It must be started with the Start / Stop button so that the pending emails are sent.

Spooler activity log:

When the email spooler is started, its activity can be viewed in the activity log.

eMailerOOo Spooler screenshot 3


Has been tested with:

  • LibreOffice 7.3.7.2 - Lubuntu 22.04 - Python version 3.10.12 - OpenJDK-11-JRE (amd64)

  • LibreOffice 7.5.4.2(x86) - Windows 10 - Python version 3.8.16 - Adoptium JDK Hotspot 11.0.19 (under Lubuntu 22.04 / VirtualBox 6.1.38)

  • LibreOffice 7.4.3.2(x64) - Windows 10(x64) - Python version 3.8.15 - Adoptium JDK Hotspot 11.0.17 (x64) (under Lubuntu 22.04 / VirtualBox 6.1.38)

  • Does not work with OpenOffice on Windows see bug 128569. Having no solution, I encourage you to install LibreOffice.

I encourage you in case of problem 😕
to create an issue
I will try to solve it 😄


Historical:

What has been done for version 0.0.1:

  • Writing an IspDB or SMTP servers connection configuration wizard allowing:

    • Find the connection parameters to an SMTP server from an email address. Besides, I especially thank Mozilla, for Thunderbird autoconfiguration database or IspDB, which made this challenge possible...
    • Display the activity of the UNO service com.sun.star.mail.MailServiceProvider when connecting to the SMTP server and sending an email.
  • Writing an email Spooler allowing:

    • View the email sending jobs with their respective status.
    • Display the activity of the UNO service com.sun.star.mail.SpoolerService when sending emails.
    • Start and stop the spooler service.
  • Writing an email Merger allowing:

    • To create mailing lists.
    • To merge and convert the current document to HTML format to make it the email message.
    • To merge and/or convert in PDF format any possible files attached to the email.
  • Writing a document Mailer allowing:

    • To convert the document to HTML format to make it the email message.
    • To convert in PDF format any possible files attached to the email.
  • Writing a Grid driven by a com.sun.star.sdb.RowSet allowing:

    • To be configurable on the columns to be displayed.
    • To be configurable on the sort order to be displayed.
    • Save the display settings.

What has been done for version 0.0.2:

  • Rewrite of IspDB or Mail servers connection configuration wizard in order to integrate the IMAP connection configuration.

  • Rewriting of the Spooler in order to integrate IMAP functionality such as the creation of a thread summarizing the mailing and grouping all the emails sent.

  • Submitting the eMailerOOo extension to Google and obtaining permission to use its GMail API to send emails with a Google account.

What has been done for version 0.0.3:

  • Rewrote the Grid to allow:

    • Sorting on a column with the integration of the UNO service SortableGridDataModel.
    • To generate the filter of records needed by the service Spooler.
    • Sharing the python module with the Grid module of the jdbcDriverOOo extension.
  • Rewrote the Merger to allow:

    • Schema name management in table names to be compatible with version 0.0.4 of jdbcDriverOOo
    • The creation of a mailing list on a group of the address book and allowing to follow the modification of its content.
    • The use of primary key, which can be composite, supporting DataType VARCHAR and INTEGER or derived.
    • A preview of the document with merge fields filled in faster thanks to the Grid.
  • Rewrote the Spooler to allow:

    • The use of new filters supporting composite primary keys provided by the Merger.
    • The use of the new Grid allowing sorting on a column.
  • Many other things...

What has been done for version 1.0.0:

  • The smtpMailerOOo extension has been renamed to eMailerOOo.

What has been done for version 1.0.1:

  • The absence or obsolescence of the OAuth2OOo and/or jdbcDriverOOo extensions necessary for the proper functioning of eMailerOOo now displays an error message. This is to prevent a malfunction such as issue #3 from recurring...

  • The underlying HsqlDB database can be opened in Base with: Tools -> Options -> Internet -> eMailerOOo -> Database.

  • The Tools -> Add-Ons menu now displays correctly based on context.

  • Many other things...

What has been done for version 1.0.2:

  • If no configuration is found in the connection configuration wizard (IspDB Wizard) then it is possible to configure the connection manually. See issue #5.

What has been done for version 1.1.0:

  • In the connection configuration wizard (IspDB Wizard) it is now possible to deactivate the IMAP configuration.
    As a result, this no longer sends a thread (IMAP message) when merging a mailing.
    In this same wizard, it is now possible to enter an email reply-to address.

  • In the email merge wizard, it is now possible to insert merge fields in the subject of the email. See issue #6.
    In the subject of an email, a merge field is composed of an opening brace, the name of the referenced column (case sensitive) and a closing brace (ie: {ColumnName}).
    When entering the email subject, a syntax error in a merge field will be reported and will prevent the mailing from being submitted.

  • It is now possible in the Spooler to view emails in eml format.

  • A service com.sun.star.mail.MailUser now allows access to a connection configuration (SMTP and/or IMAP) from an email address following rfc822.
    Another service com.sun.star.datatransfer.TransferableFactory allows, as its name suggests, the creation of Transferable from a String, a binary sequence, an Url (file://...) or a data stream (InputStream).
    These two new services greatly simplify the LibreOffice mail API and allow sending emails from Basic. See Issue #4.
    You will find a Basic macro allowing you to send emails in: Tools -> Macros -> Edit Macros... -> eMailerOOo -> SendEmail.

What has been done for version 1.1.1:

  • Support for version 1.2.0 of the OAuth2OOo extension. Previous versions will not work with OAuth2OOo extension 1.2.0 or higher.

What has been done for version 1.2.0:

  • All Python packages necessary for the extension are now recorded in a requirements.txt file following PEP 508.
  • Now if you are not on Windows then the Python packages necessary for the extension can be easily installed with the command:
    pip install requirements.txt
  • Modification of the Requirement section.

What has been done for version 1.2.1:

  • Fixed a regression allowing errors to be displayed in the Spooler.
  • Integration of a fix to workaround the issue #159988.

What remains to be done for version 1.2.1:

  • Add new languages for internationalization...

  • Anything welcome...

emailerooo's People

Contributors

hosseinn avatar prrvchr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vman45 hosseinn

emailerooo's Issues

Issue with google workspace adresses

Hello,

I tried an automatic translation with deepL. The result may not be very comprehensible, so I'm adding the original below.

I like your extension, but I can't configure it.
I followed the instructions to install it and everything seems to have worked.
When I try to configure the connection, everything stops at "Configuration found on Mozilla IspDB..."
I'm using a Google Workspace address (with a domain name other than gmail.com). Maybe that's the problem, because with a regular gmail address, I get to the end of the configuration and successfully send a test email.

Second problem (I don't know if they're related): when I click on "publish a document", I can't add a mailing list. The Add button is active, but nothing happens when I click on it. My data source is a free office workbook containing a single sheet. I've added a primary key in the form of an integer in column A. There's a header row.

I don't know what information to add, but I'll answer your questions.
Thank you for your work and your answers.

Translated with www.DeepL.com/Translator (free version)

Bonjour,

J'ai essayé une traduction automatique avec deepL. Le résultat n'est peut-être pas très compréhensible, alors je rajoute en dessous l'original.

Votre extension me plaît bien, mais je n'arrive pas à la configurer.
J'ai suivi les instructions pour l'installer et tout semble avoir réussi.
Lorsque je tente de configurer la connexion, tout s'arrête à "Configuration trouvée sur Mozilla IspDB..."
J'utilise une adresse Google Workspace (avec un nom de domaine différent de gmail.com). C'est peut-être le problème parce qu'avec une adresse gmail classique, j'arrive au bout de la configuration et j'arrive avec succès à envoyer un email de test.

Deuxième problème (je ne sais pas s'ils sont liés) : lorsque je clique "publiposter un document", je n'arrive pas à ajouter une liste de diffusion. La bouton Ajouter est actif, mais il ne se passe rien quand je clique dessus. Ma source de données est un classeur libre office contenant une seule feuille. J'ai ajouté une clef primaire sous la forme d'un entier en colonne A. Il y a une ligne d'en-tête.

Je ne sais pas quels renseignements ajouter, mais je répondrai à vos questions.
Merci pour votre travail et vos réponses.

SMTP assistant failed

Hi,
I installed smtpMailer OOo on Libreoffice 7.2.7.
The installation is OK, but when I want to add an expediter, the programm freeze :
Capture d’écran 2022-06-19 230932
Thank you for this application which must allow a mailing from a gmail address
I use LO 7.2.7, OS : windows 10.
the extensions installed are :
smtpmailerOOo 0.0.2
Oauth2OOo 0.0.5

I couldn't install jdbcDriverOOo.oxt
message :
_

(com.sun.star.uno.RuntimeException) { { Message = "[jni_uno bridge error] UNO calling Java method writeRegistryInfo: non-UNO exception occurred: java.lang.UnsupportedClassVersionError: io/github/prrvchr/jdbcdriver/RegistrationHandler has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0\X000ajava stack trace:\X000ajava.lang.UnsupportedClassVersionError: io/github/prrvchr/jdbcdriver/RegistrationHandler has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0\X000d\X000a\X0009at java.lang.ClassLoader.defineClass1(Native Method)\X000d\X000a\X0009at java.lang.ClassLoader.defineClass(Unknown Source)\X000d\X000a\X0009at java.security.SecureClassLoader.defineClass(Unknown Source)\X000d\X000a\X0009at java.net.URLClassLoader.defineClass(Unknown Source)\X000d\X000a\X0009at java.net.URLClassLoader.access$100(Unknown Source)\X000d\X000a\X0009at java.net.URLClassLoader$1.run(Unknown Source)\X000d\X000a\X0009at java.net.URLClassLoader$1.run(Unknown Source)\X000d\X000a\X0009at java.security.AccessController.doPrivileged(Native Method)\X000d\X000a\X0009at java.net.URLClassLoader.findClass(Unknown Source)\X000d\X000a\X0009at java.lang.ClassLoader.loadClass(Unknown Source)\X000d\X000a\X0009at java.lang.ClassLoader.loadClass(Unknown Source)\X000d\X000a\X0009at java.net.FactoryURLClassLoader.loadClass(Unknown Source)\X000d\X000a\X0009at java.lang.ClassLoader.loadClass(Unknown Source)\X000d\X000a\X0009at com.sun.star.comp.loader.RegistrationClassFinder.find(RegistrationClassFinder.java:53)\X000d\X000a\X0009at com.sun.star.comp.loader.JavaLoader.writeRegistryInfo(JavaLoader.java:376)\X000d\X000a", Context = (com.sun.star.uno.XInterface) @0 } }

_
Could you help me ?
Thank you
Christophe

Having difficulty setting up

smtpMailerOOo (it says in the titlebar) is trying to find configuration for address: [email protected] (one of my many addresses) and has got to "Mozilla IspDB search..." and has not moved from there in over an hour. It should have found GMail's settings quickly but hasn't. Now what?

Support personalized subject line in mail merge dialog

I am looking for the possibility to have personalized subject line in mail merge function.

Suppose the data source have a column called subject and I would like to be able to reference this field in the send mail merge dialog, e.g. <subject>. Or generally speaking reference combined fields, e.g.: foo <field1> bar <field2>.

It seems that there is another extension available to provide this feature, but not for LibreOffice: [1].

Another option would be to support this feature in core mail merge feature of LibreOffice.

[1] https://www.mapilab.com/blog/how-to-customize-subject-line-in-mail-merge-toolkit-for-outlook/

Seeking example code

I finally have managed to get everything installed properly and working ... up to a point. I was rather hoping for some demonstration code and I haven't seen much. I may not be looking in the correct location.

My client already has an application fully built and is not about to make wholesale changes to accommodate a different workflow. I have been asked simply to find an email tool that will talk to GMail via OAuth and bolt that on as simply as possible to the existing code base in place or the previous username/password email client that had been in use before.

Is it impossible simply to create a mail object, populate fields and send as one might do in C# with Microsoft's Mail libraries or via Google Apps Script and GMail? If it is impossible, please point out to me a possible solution.

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.