Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PDF email attachment appear only in selected mails

Featured Replies

Hi everyone!

I am creating a rotation schedule for employees in an 8 hour shift system.

I want to send an individualized PDF of our database as an email attachment to all employees highlighting when and where they have to work. I set up a looping script that saves the individualized PDF to a temp path and then creates an email with the PDF as an attachment. Everything works fine except that some of the time the attachment is missing in one or more emails. The weird thing is, that every time I do the script the attachment is missing in different emails.

Thank you very much in advance for the help.

Cheers,

Sebastian

Please post the script.

  • Newbies

You may want to try pausing the script for a second or two after the Save as PDF step to give the process time to actually save the file.

  • Author

Thanks for the advice and sorry for the delayed response. I tried pausing the script but unfortunately that had no effect.

Here is the script in a nutshell:

Loop

Go to Layout ["Dienstplan" (Dienstplan)]

Enter Preview Mode []

Set Variable [$TempPDF; value:Let (prefix = Case ( Abs ( Get ( SystemPlatform )) = 1; 1; "filemac:"; "filewin:"); prefix & Get (TemporaryPath) & "Dienstplan" & ".pdf")]

Save Records as PDF [Restore; No dialog; "$TempPDF"; Records being browsed]

Send Mail [send via E-mail Client; To: field one; Subject: field two; Message: field three; "$TempPDF"]

Enter Browse Mode []

Go to Layout ["Ärzte (Ärzte)]

Go to Record/Request/Page [Next; Exit after last]

End Loop

I don't think you are stepping through the correct records.

The layout switch to "Artze" is based on a different table so the go to next record step is advancing in the wrong table.

You don't need the preview mode either.

Other than these the script should run fine, but there is still a possibility of a timing issue as you are using the same PDF file name for each loop - so you could end up over writing the PDF before the e-mail application has got going. You would be better off introducing some uniqueness to each PDF - maybe the record ID from the record being produced?

  • Author

Thanks for the ideas, but stepping through the records works fine. I forgot a script step that copies a field in layout "Arzte" and includes it in the layout "Dienstplan".

I think your on to something with the timing though, I'll give it a try and let you know.

  • Author

IdealData,

I tried a million different things and the only thing that worked was making the PDF-name unique. Now I have a folder with a bunch of PDFs that I have to trash, but at least it works 100%. Thanks for your advice.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.