Jump to content

Custom notifications


JKrause

Recommended Posts

Hello,

I've been working on a simple action that moves approved files from our internal VFX server to a server used by our editors. The editors don't use FTrack, so I'd like to create custom email notifications to inform them when a file has been moved into their transfer folder.

Is there a way to access email via the API? Since the editors aren't Ftrack users, I would like to store their email in the shot's metadata and send a simple "Shot XXXX has been transferred" notice whenever the action is used.

Any advice is appreciated,

Joshua

Link to comment
Share on other sites

  • 4 weeks later...

Thanks for the advice! Unfortunately our editors aren't up for adopting anything new. Therefore I simply added their email addresses as metadata at the project level, queried it via API, and used Python's default smtplib module to send notification emails. This worked great.

This brings me to my next question. My original notification script was coded as a generic Ftrack action, but my supervisor requested that I convert it into a Connect hook. Unfortunately, after a bunch of debugging, I've found that 'import smtplib' doesn't work in Connect. The hook fails to load. Is there a known work-around?

EDIT: Mattias gave me some help in chat. I didn't realize that Connect has its own Python library. I placed a copy of the smtplib into 'Library.zip' and my action worked as expected.

Link to comment
Share on other sites

On 2/10/2016 at 9:13 PM, JKrause said:

EDIT: Mattias gave me some help in chat. I didn't realize that Connect has its own Python library. I placed a copy of the smtplib into 'Library.zip' and my action worked as expected.

I'm glad to hear that Mattias Seebergs could help you. That is true; ftrack Connect is a cx_Freeze bundle that has it's own python interpreter and libraries bundled - to ensure that it works regardless of installation. Unfortunately it does not package all of the standard libraries into Library.zip. Another way that may be easier than modifying Library.zip is to do a sys.path.append('path/to/smtp/library/') in your script. That way you do not have to modify Library.zip every time you update Connect.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...