Jump to content
Server Maintenance This Week. ×

Need tweaking help with sending an attachment (using Send Mail) in WebDirect


Recommended Posts

Howdy howdy:

Yes, I know it needs to be done using PSoS as a subscript and have the BE plugin installed, but I must be missing a crucial step in the process or I'm just plain messing up. For attachments, I used $_ExportFile and $_FilePath_export together and separately (as attachments), but no dice: the e-mail is sent without any data or attachment.

If I move the Send Mail step back to the "parent" script so it fires after the jump to the subscript, all the field data populates as it should but no attachment.

I've thrown all caution to the wind as we're running FMS v20 and FMP v20 clients. I'm just a digital daredevil.

TIA for your help!

Untitled_Redacted.pdf

Link to comment
Share on other sites

are you sure the global container field has a valid document? Remember if this is PSOS the globals typically start out blank and would need to be set. 

Personally, I would structure this differently and create a Single Send Mail Utility script that can send an email you would construct a JSON payload that would include all the elements and content you wish to pass, From / To / Cc / Bcc / Subject / Message / Attachments /  Credentials (perhaps in a Custom Function) 

This utility script would parse out all the elements of the JSON object as $variables and these would go into the Send Email script step.

You might also want to check to see if the file exists and clean up after the email is sent instead of keeping it in the documents folder.

And you may wish to do some error capture after exporting the file if that fails return to the parent script or after sending the email and returning that as a script result to the parent script. 

 

 

Screenshot 2023-05-02 at 3.39.07 PM.png

I have a system now that did things willy-nilly and there are dozens and dozens of scripts that have different email passwords and credentials or a slightly different way of sending email and it's a total mess. With a little forethought, your future self will be most grateful! :D 

Link to comment
Share on other sites

I'm sure there's a file in the global field when I started, but I think you're right in that it "disappears"; I'll noodle on that tomorrow--maybe resetting the field, or using a variable, might be the ticket.

Great suggestion you have except that I know this >< much about JSON. (I know I need to learn it but I don't have the luxury of spare time.) : | I'll poke around online tomorrow to see if I can figure out a way to incorporate what you suggest.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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