Jump 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.

Server Side Script Malfunctioning

Featured Replies

  • Newbies

I have a database of contacts that need to be emailed (based on find criteria) at different times of the week and *tried to create a script that would send the email through the server automatically. Unfortunately it leaves out random emails and I can't figure out why. The problem doesn't seem to be in the FIND portion. Any ideas?

GO to Layout [Layout Name (Table)]

If [DayofWeek (Get (CurrentDate))=2]

Perform Find

Sort Records

Perform Script [Ticket Count Email]

Else If I do this for every day of the week Monday thru Fri (I think I could use a SetVariable here to make this less cumbersome but I don't know how)

The Find seems to work fine. Here is the ticket count script:

Go to Record/Request/Page [First]

Loop

Send Mail SMTP Server settings are here and seem to be correct because the majority of emails go through.

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

End Loop

 

Any ideas. Maybe its my server just dropping them? Thanks so much!

 

A couple of things:

- your "perform find" early on: you have the settings stored within that?  Not a big fan of it because you can't see / read it or troubleshoot it just by setting it and seeing what it does

- you don't need to loop through the records to send the email.  One of the options is to send one email per found set...

 

One of the first things to do is to log the result from Send Mail with Get(LastError) for each contact you send. Then if that turns up nothing, you'd have to dig into the logs of your email server (the SMTP relay that your FMS uses).

The sorting of records seems pointless?

  • Author
  • Newbies

A couple of things:

- your "perform find" early on: you have the settings stored within that?  Not a big fan of it because you can't see / read it or troubleshoot it just by setting it and seeing what it does

- you don't need to loop through the records to send the email.  One of the options is to send one email per found set...

 

Here is the Find:

Find Records   Dates::Date: [>=//] AND Dates::T Count Date: [=Thurs]

Omit Records   Dates::On Sale [.//]

Omit Records   Dates::Itin Topsheet: [=F]

OMit Records   T COunt Day: [=Auto]

OMit Records Dates::TIcket Count Start Date: [>//]

ITs my understanding that when you send one email per found set, the script won't send if there is an error in any of the emails so I wanted to avoid that.

One of the first things to do is to log the result from Send Mail with Get(LastError) for each contact you send. Then if that turns up nothing, you'd have to dig into the logs of your email server (the SMTP relay that your FMS uses).

The sorting of records seems pointless?

I Have never used this function. Where do I place it within the loop? Will the other emails get sent if there is an error in one of the records or will it stop the whole script from that point?

One issue with the loop is that you may have to insert a pause every say 50 or 100 iterations otherwise you may be overloading your SMTP server with multiple email requests per second...

  • Author
  • Newbies

interesting. I hadn't thought of that. I will see how to do that and see if it helps. Thanks!

Create an account or sign in to comment

Important Information

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

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.