Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

How to preview a mail

620 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Zeely_Beg408
4 - Data Explorer
4 - Data Explorer

Hello everyone,

I need a little help about how to preview an email before send it. 

I explain myself, I need people who uses my interface to be able to preview their email  before send it.

What I have now is when an entry is create by an automation  I have a script who send it (Outlook) but don't allow to preview the mail.

I came up with an idea is to create a formula with "mailto" who allows to have an interaction with outlook with that I create a bouton and when people click on the bouton is create a preview of their mail directly on outlook with the information they put in a formulaire when the creation of an entry.

But I have two problems : 

- "Mailto to" not allow html so I create a macro in Outlook to put my text into html format

- Limitation of numbers of characters by 2000 so i can only use Firefox for browser

So I don't have any idea to find something more optimized because I have an html format kinda complexe for the content of my mail and I need to allow preview a mail.

Thank you for your help,

Zeely

 

3 Replies 3
alison569
4 - Data Explorer
4 - Data Explorer

Hi Zeely,

It sounds like you're trying to offer a way for users to preview emails in HTML format via Outlook before they send them, but you're hitting some limitations with the `mailto:` approach, particularly the lack of HTML support and character limits.

### Here are a couple of alternative approaches that might help you achieve this:

### 1. **Create a Draft Email in Outlook Using a Script (VBA or Office Script)**
Instead of using `mailto:`, you can use **Outlook VBA** or **Office Script** to programmatically create an email draft that will open in Outlook with the content, including HTML formatting. Users can then preview, edit, and send the email themselves.

Here's an example VBA code that creates an HTML email draft:

```vba
Sub CreateDraftEmail()
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)

With olMail
.To = "recipient@example.com"
.Subject = "Email Subject"
.HTMLBody = "<html><body><h1>Hello!</h1><p>This is a test email.</p></body></html>"
.Display 'This opens the email in draft mode
End With
End Sub
```

This code opens the email in the Outlook editor with the provided HTML content, and the user can manually review it before sending.

### 2. **Use an External Email API for Preview**
Another option is to use an email API service, like **SendGrid**, **Mailgun**, or **SMTP**, where you can first generate the email in HTML format and send a preview of it to Outlook or any other email client.

- You can generate the email content and send it to the user’s inbox for review.
- Users can open the email, review it, and then decide whether to forward it or use an Outlook add-in to approve and send it.

### 3. **Embed an Email Preview in Your Interface**
If you're using a web interface, you can create an HTML email preview inside the interface itself. This would involve:

- Generating the HTML email content based on the user input.
- Rendering the email as a preview directly in the browser before sending it.

After the preview is confirmed, you can use an API or Outlook integration to send the actual email.

### 4. **Automate HTML Formatting via Macro**
You mentioned you already have a macro to convert the text to HTML. You can expand on this to dynamically create the email and open it as a draft for preview. Since Outlook VBA has no character limit, this method should solve your `mailto:` limitations.

### Final Thoughts
The VBA or Office Script method should be the most direct and seamless if you are working within Outlook. It gives you full control over HTML formatting, and the email is opened for the user to preview and manually send.

Let me know if you need more details on any of these methods or have additional questions!

 

TravisStacy
4 - Data Explorer
4 - Data Explorer

Hi Zeely,

You’ve done a fantastic job putting this solution together! It’s clear that you’ve thought through the user experience by providing a way to preview emails, which is definitely a helpful addition.

To address the "mailto" HTML limitation and character cap, here are a few alternative ideas that might help:

  1. Outlook Draft Emails: Instead of sending the email directly, you might be able to adjust your script to create a draft in Outlook. This way, users could view and edit the email as a draft with full HTML formatting before sending.

  2. Using Power Automate: If you have access to Microsoft Power Automate, it could allow you to create draft emails directly in Outlook using data from forms, bypassing the "mailto" constraints and supporting more complex HTML.

  3. Advanced VBA Scripting: Since you’re already working with macros, another approach could be to enhance the VBA script to create a draft email with the necessary HTML. This would avoid both the character limit and browser dependency, offering more flexibility for your HTML content.

Each of these ideas could help preserve the complex formatting and allow for a preview feature. Let us know how it goes or if you’d like more help with the VBA option—great job, and I’m sure you’ll have a smooth solution in place soon!

BegizeelCode
4 - Data Explorer
4 - Data Explorer

Hi everyone,

Thanks for your answers! Here are the different solutions I've implemented to solve my problem.

Context:

I've created a form on Airtable allowing users to fill in the characteristics of a product. This information is then sent via an Outlook e-mail to a specific address, which automatically generates a new entry in our database.

Airtable → Outlook → Users

The aim was to maintain a smooth, linear process, avoiding any double entry for the user.

As users are human, errors can occur, and the structure of the form can sometimes be unsuitable for a totally new product.

As a result, it was no longer possible to automatically send the form directly via Airtable.

For products not yet set up in the system, I added a unique text zone to the form. This allows you to :

  1. Temporarily integrate the product into the system.
  2. Send a draft e-mail for validation before final dispatch

=> This gives me time to set up the new product structure correctly for future products.

How do I generally manage the creation of a draft?

- For small items of content, I use mail:to :

  1. Possibility of sending the mail directly from the user's mailbox
  2. Small formula to do ex: CONCATENATE("mailto:" & {EMAILTO} & "?subject=" & ENCODE_URL_COMPONENT({SUBJECTEMAIL} & "&body=" & ENCODE_URL_COMPONENT({BODYEMAIL})

- For some content that isn't codified, I use an enriched text zone that serves as a draft zone (very rarely used, as we use a lot of complex HTML content).

- For large and complex content, I use MAKE thanks to a script I found on Youtube to make the link between the two platforms. I use a Webhook and the draft arrives at a common address.

  1. This allows me to have a server based in Europe.
  2. Using a complex HTML format
  3. Converting Airtable's MARKDOWN format to HTML

Initially, I didn't want to connect our database to MAKE, but the urgent need for a system for sending drafts led me to adopt it temporarily.

Having never written a script in the Airtable language, it was difficult for me to code a stand-alone solution for opening an e-mail draft. We were initially using Mandrill for automatic sending, but I couldn't find a clear and understandable solution with this platform for me.

- Zeely

#-------------------------------------------------------------------------------------------------------------------------------------

Salut tout le monde,

Merci pour vos réponses ! Voici les différentes solutions que j’ai mise en place pour résoudre mon problème.

Contexte :

J’ai créé un formulaire sur Airtable permettant aux utilisateurs de renseigner les caractéristiques d’un produit. Ces informations sont ensuite envoyées via un e-mail Outlook à une adresse spécifique, qui génère automatiquement une nouvelle entrée dans notre base de données.

Airtable → Outlook → Utilisateurs

L’objectif était de maintenir un processus fluide et linéaire, évitant toute double saisie pour l’utilisateur.

Les utilisateurs étant humains, des erreurs peuvent survenir, et la structure du formulaire peut parfois être inadaptée à un produit totalement nouveau.

Ainsi, l'envoi automatique via Airtable directement n'était plus possible.

Pour les produits qui ne sont pas encore paramétrés dans le système, j’ai ajouté dans le formulaire une zone de texte unique. Celle-ci permet :

  • D’intégrer temporairement le produit dans le système.
  • D’envoyer un brouillon d’e-mail pour validation avant envoi définitif.

=> Cela me laisse ainsi le temps de paramétrer correctement la nouvelle structure du produit pour les prochains produits.

Comment je gère la création d'un brouillon de manière générale ?

- Pour les petits contenus, j'utilise mail:to :

  1. Possibilité d'envoyer le mail directement de la boite mail de l'utilisateur
  2. Petite formule à faire ex : CONCATENATE("mailto:" & {EMAILTO} & "?subject=" & ENCODE_URL_COMPONENT({SUBJECTEMAIL} & "&body=" & ENCODE_URL_COMPONENT({BODYEMAIL})

- Pour certains contenus qui ne sont pas codifiés, j'utilise une zone de texte enrichie qui sert de zone de brouillon (très peu utilisé car nous utilisons énormément de contenu HTML complexe)

- Pour les gros contenus et contenus complexe, j'utilise MAKE grâce à un script que j'ai trouvé sur Youtube pour faire le lien entre les deux plateformes, je passe par un Webhook et le draft arrive dans une adresse commune.

  1. Il me permet d'avoir un serveur basé en Europe.
  2. Utilisation d'un format HTML complexe
  3. Convertir le format MARKDOWN d'Airtable en HTML

=> Je peux créer mon draft de mail selon les différents besoins du contenu

Je ne souhaitais initialement pas connecter notre base à MAKE, mais l’urgence d’un système d’envoi de brouillons m’a poussé à l’adopter temporairement.

De plus, n’ayant jamais écrit de script dans le langage d’Airtable, il m’a été difficile de coder une solution autonome pour l’ouverture d’un brouillon d’e-mail. Nous utilisions initialement Mandrill pour les envois automatiques, mais je n’ai pas réussi à trouver une solution claire et compréhensible avec cette plateforme.

- Zeely