I helping a client with a Umbraco 4 solution. When they send a email message to some special email addresses Umbraco picks them up and creates news post with the email subject, message and picture. One of the emails are failing. Do any of you now where i need to look?
That's not very specific, this could have been achieved in one of many ways. Umbraco doesn't have anything like that built in, so my guess would be that there's a scheduled task that checks the email account somewhere and creates the posts.
To check if the scheduled task is being run by Umbraco, look in /config/umbracoSettings.config and look for the <scheduledTasks> element. If there's something listed there, that might give you a clue of where to look.
If there's nothing there, the task is probably being run from elsewhere (windows task scheduler, or event hooks on the mail server maybe), so you'd have to look there.
You could also check the /config/BaseRestExtensions.config file and see if there are any endpoints listed there that might give you a clue as to where the code that does the page creation might live.
Related
I am making an event registration tool in Rails and I am having trouble working out the mailing section. I am using Mailgun API and I've got a generic "Thank you for Registering" email working when the user signs up as well as a contact form submission that comes to my email. Part of the requirements for the application is the ability to send promotional emails (separate from Thank you for Registering emails). These promotional emails are more like (One week reminder) type emails.
So these emails need to be able to be created by the admin setting up the event as this is a general purpose tool. So to save the emails the admin creates, I have a mailings object. So the relationship is a bit like this:
Event has many mailers, registrations, etc. (and those belong to the event). They are nested resources because they are specific to an event. Now I need to bridge the gap of how to go from the mailers created by the admin to sending them to Mailgun. The problem is we will have to have the ability to add recipients because they may want to send to people besides the registrants for the event. So I need to go from the mailing#show (which shows a preview of the mailing and will need to be able to add/remove recipients), loop through all of the recipients, and send the message that is in the mailing.message field.
I am so close to finishing this tool except for this mailing which I cannot wrap my head around. I see a lot of examples that create a mailer but I am not sure if that would work for me since the message are unique and it needs to get the message and subject from the mailer object. Any advice or guidance? I am really struggling to get this part done.
I assume you have a User model with an email column
I would setup an extra model i.e.
class PromoMail < ActiveRecord::Base
has_many :users # recpients
validates :body, presence: true
end
Then add a controller, where admins can create these and insert the Mail content in the body field and add recipients.
Then create a new method in your existing mailer to send the mail with the yielded body to one user.
Then add a action to the forementioned controller to send the PromoMail by looping over the associated users and call the ne mailer metod with each.
Couple of steps here, without going into much detail.
1) Make a rake task which looks for any emails which needs to be sent out, and sends them out. You might need to expand your schema to record whether a mail (or mailing or whatever) has been sent already. The rake task itself shouldn't have much code, it should just call a class method in eg User or Mailing or something.
You'll need to think about how the system can decide which emails need to get sent out. I find that flowcharts can be helpful here: it's going to involve iterating over all users, or all mailings, or something, and applying various logical tests to them. You may find that your current schema isn't up to the job, in which case expand it.
2) Schedule this rake task to be run at regular intervals, eg once a day or once a week. Various scheduled task runners are available, eg cron, or if you're on Heroku you'll need to use their Scheduler tool, for example.
I'm looking for a way to control the way the "Creating Issues and Comments from Email" works. At the moment since we are using the built in system any received email that has no subject cause the service to fail with the message "Issue must have a summary. The mail message has an empty or no subject.". Every time this happens we have to process the email manually.
Do you know of any way around this?
EDIT
The emails are being sent by customers, so I can't enforce all of them to send a subject.
The problem is that the mail creation service won't process the email once it has no subject.. so setting default value won't help. The only way i can think of is rewriting the mail service. Does anyone knows how could i do that? i I found the original source code here, but not sure how to build and deploy it.
Anyway can think of any other way?
Thanks!!
I assume that you just added some service to Jira in admin interface which automatically serializes emails.
If you want to fully customize the default behaviour, you can write your own simple jira plugin.
See the Atlassian pages:
https://developer.atlassian.com/display/DOCS/Set+up+the+Atlassian+Plugin+SDK+and+Build+a+Project
https://developer.atlassian.com/display/JIRADEV/Component+Plugin+Module
Your atlassian-plugin.xml should include something like:
<component key="message-handler-factory" class="com.atlassian.jira.plugins.mail.internal.DefaultMessageHandlerFactory" public="true">
<interface>com.atlassian.jira.service.util.handler.MessageHandlerFactory</interface>
</component>
You can for example extend the CreateOrCommentHandler class.
I'm working at a helpdesk application where i have a standalone script that queries a mail server and parses the mail it finds there.
I'm facing the following issue: How do i figure it out in a reliable way what mail is in reply to what mail?
I could add something in the subject like "[ticket:21312]" and look for that but what if the user changes the subject? Is there another way? Can i do it by setting a custom mail header and look for that or the header will not be preserved between mail servers on reply back from user?
What about when i send a message from my application to a non existing user or a user that has quota full and his server replies back with the usual standard message "the mail daemon at .... could not ...." then the subject will also be modified and i can't place the message correctly as a reply to an existing mail.
How does gmail do it? There the messages are sorted perfectly in almost all of the cases.
in helpdesk email piping there are 3 basic methods:
a) include the id in the subject somewhere (works fine in practice)
b) have the id in the body somewhere
c) use an auto-generated email alias with the id, like "case-76236781980893#helpdesk.mycompany.com". that can easily be handled by something like procmail or a script to pick out the id.
gmail might use a combination of the subject, In-Reply-To header (may not be defined) (References and Original-Message-ID headers possibly as well), and various heuristics, which work very well, but of course not necessarily bulletproof, and slightly more involved to implement. something like nestscape's original threading algorithm perhaps. though some have reported that gmail doesn't use the In-Reply-To header and relies mostly on the subject (as in this post).
As you say custom headers might get lost and the subject might change. Use both. If one exists then you can identify the thread. I don't know of any better way to solve this.
If your message was sent with a Message-ID-Header any standards-conform mailer should add a In-Reply-To-Header referencing your Id. Additionally Referencesshould contain a list of all previous mails in this thread.
This works with most mail clients, to be safe for the bad clients you have to use the subject, the easy way is by adding the "[issue:123]" thing, a secondary fallback is to recognize the subject (after cutting of the "Re:" part in all the variations) for this it could help that you know most of your legitimate senders ...
We are working on an online food ordering application. When the user orders something from any restaurant, an email is sent to the restaurant's email address mentioning the order details. However, our client wants that an order print out should be generated automatically as soon as a new order is received.
Is it feasible using ROR? If not, any alternate solution to the problem?
When my group wrote something like this we went a little lower tech, and had the system generate a fax and send it to a fax machine at the restaurant. Of course, that's mainly because this was a system working across many restaurants, with disparate IT infrastructures, and the one thing they had in common was each had a fax machine.
I would figure this could be done in 1 of two ways:
1- Outlook event-- Outlook has the ability to set up 'rules', one of which I think allows printing.
2- Create a script that runs every few minutes, checks the email (either through IMAP, or POP, depending on the account), and prints all of them out.
See this: http://ruby.about.com/od/tasks/a/pop3.htm for info on how to check POP3 mail with ruby on rails.
For printing, the links mentioned here seem useful: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/504a616bf3e28057/ff6cb91462dfe961?pli=1
Ensure that you have 'from' or 'subject' filters setup, otherwise there will be a lot of spam printing.
You can use software to print your order automatically when email is received, it supports also print attachment like pdf, word, etc...
It is used by a lot of restaurant to print online order:
http://www.automatic-email-manager.com/
We would like to implement a feature by which users could send an email to an application specific address and we will parse the message and take certain actions on it, similar to 37signals's backpack (and probably some of their other apps).
If anyone has done something similar, could you fill me in on how you did so? I'm unsure on how to, at a high-level, 'import' the email into the app so that I could process it.
Thank you.
I have recently implemented that exact functionality in rails. I would advice you to look at the 'Receive E-mail Reliably via POP or IMAP' in the the Advanced Rails Recipes book.
I've personally found that the best source for getting this up and running and it explains how to do far better than I can. Good luck which ever way you choose to do it :)
Here's how I fetch from a POP server:
require 'net/pop'
pop = Net::POP3.new('mail.yourdomain.com')
pop.start(account, password)
pop.each_mail do |m|
email = TMail::Mail.parse(m.pop)
email.base64_decode
OttoMailer.process_email_in(email, m.unique_id)
m.delete
end
pop.finish
Why not run a Ruby SMTP mailserver, which will receive the mails via port 25, and then you can parse/interpret etc. as you wish ?
(I say Ruby since that's how you've tagged your question)
An alternative solution is to run procmail (or similar), pattern match on the subject, and then invoke scripts (configured in the .procmailrc file). However that may not scale so well for large volumes of mail.
ActionMailer can receive e-mails as well as send them! I don't remember how this is done but if you look at the documentation you can see it there. But from memory the e-mail gets piped through procmail into a script in the script directory.
There seems to be a book on the subject as well.
Good luck! :)