Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Linking problem within e-mail #873

Closed
ketzusaka opened this Issue · 1 comment

2 participants

@ketzusaka

Hello,

I have a system for submitting support requests with a screenshot being uploaded to cloud files. I'd like to have an e-mail sent with the submission to inform me of updates. However, when I pass the SupportRequest object into my mailer and print out the screenshot url it's a relative path to the local upload, and not the cloud file.

If I do a logger.info with the screenshot immediately after the save it displays the proper URL.

I'm sending the mail through an observer after_create. Does carrierwave not upload the file before the observer is handled? If that's the case maybe the solution is just updating the docs so people know not to use that method and to push it off to a background job or something of that matter?

Thanks for reading,
James

@bensie
Owner

CarrierWave uploads the file somewhere in the Rails callback chain, so it's likely that your upload has not been saved before the observer is getting kicked off. I would recommend using after_commit and you should always send emails in the background anyway.

In the future, please post usage issues to Stack Overflow or to the Google Group.

@bensie bensie closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.