This topic was automatically generated from Slack. You can find the original thread here.
Hello! I’m having an issue with a Gmail workflow where those receiving emails sent from this workflow can’t open docx files. pdf works fine, but docx can only be opened if you rename the file and add docx to the extension, or you open it in word. The issue with this is that the user only knows it’s a docx file when it doesn’t open normally, so not a great user experience if they have to rename it or try to open it one way then another. I’ve been thinking I could use the filename as the attachment object key (currently I’m just using a string), but the key is text only. Which is a little weird because the help text for that field suggests the key must be the filename and it must have the extension. But if it’s text only obviously that won’t work because the file name and type are dynamic.
Hi , I think you can use Pipedream’s expressions to have the filename dynamic (Read more here). For example, you can construct the object in the attachments prop as:
Thanks! Haven’t tried this yet but I wouldn’t have guessed at the double curly brace wraps. Also didn’t realize you could do template literals in there. I’m a web dev so I see what you’re going for here. Thanks for the direction.
There’s definitely a bug related to attachments in the Gmail Send Email action.
I used this docx example document because it is a direct link to the file.
From my test, though, it seems that even .pdf files are not being parsed correctly as attachments…
I created an issue, you can get notified for changes by subscribing to it.
Thank you for reporting this bug!
also what do you make of the help text below that field? it seems that a developer at some point believed that it was necessary to have the file extension and filename in the field as the object key
Add any attachments you’d like to include as objects. Each key should be the filename and it must contain the file extension (i.e. .jpeg, .txt). The value should be the download url link for the file.
that’s fine for the custom expression but doesn’t make sense for the “construct an object” tab since the key field is text only. in order to use the filename and extension as the key there it would have to be an expression, as that’s dynamic.
Pipedream workflows support dynamic custom expressions using curly brackets, {{}} , as Leo mentioned above. For example, it is possible to use {{steps.trigger.event.filename}}.docx and it will substitute the part inside the curly brackets