How to send the notification mail to user? - ruby-on-rails-3

I am using this link http://guides.rubyonrails.org/action_mailer_basics.html to send the mail notifications to user upon the creation,deletion and edition of the user and will get the mail.It works fine for me.
Now What i want is when the user is created at the time of the creation we will have the radio button for enabling the mail notification if it is enabled then only it will get the notification mail.So what i need to do????
Any help would be appreciated..
Thank you

In the UserController code only send an e-mail if the user attribute to opt into email is set:
if #user.save
# Tell the UserMailer to send a welcome Email after save
# IF MAIL NOTIFICATIONS ARE ENABLED
if #user.enable_mail_notification then
UserMailer.welcome_email(#user).deliver
end
end

Related

google-calendar API inform of event reminder

I need to integrate with google calendar, I have the basic stuff with API happening, but now realised that a reminder only informs via email, SMS
So the google api "push notification", POSTs to a URL wont work with reminders...
So how can I inform in my app that a reminder is triggered, is there a work around?, checking email is not very scalable. And polling the google calendar server, is not scalable either?, I will have to poll each user account on my solution?
How to notify of reminder with API?, thanks
[what are "pop ups" as other notifier method on above link for google-calendar?]
Regarding your question about popup, it is stated that reminders are sent via a UI popup.
EventReminder[] reminderOverrides = new EventReminder[] {
new EventReminder().setMethod("email").setMinutes(24 * 60),
new EventReminder().setMethod("popup").setMinutes(10),
};
You may refer with this SO thread: How to Create a Reminder Notification wherein you need AlarmManager to schedule your notification at a regular bases (daily, weekly,..) and a Service to launch your notification when the AlarmManager goes off.

Mark Liferay Notification as Read programmatically

I want the notification to be marked as read after the user Approves or Rejects the Notification. Here on click of approve or reject I am calling an action url. The method is called Successfully but the notification is still displayed as not read. The Notification screen is as below:
Please Help. Thanks in Advance.

Xcode in app email adding a From text field

Ok, so I have successfully made my first in-app Email app using MFMAilComposer. I have the toRecipients textfield added, as well as subject and body etc. So I understand that the email will not send if I use the simulator and will send with an iPhone. However, when a person receives the email, how is that person supposed to know whom he received it from? With this in mind, a "From" field should be in order. I appreciate all answers, and thanks in advance :)
You don't have to handle this, the mail composer does it for you. When the composer is shown it defaults to the users default email account but if they want to choose which email address they are sending from they can simply tap their email and a list will expand allowing them to choose from which of their emails to send the message.

getting from email address when using MFMailComposeViewController

i want to show user from which account he is going to send email when he is going to send an email using my app and i am using MFMailComposeViewController. so what is the way of getting the from email address.
There is no way to get this information. Mail sent via MFMailComposeViewController is always sent from the user's default address.
Mail sent via MFMailComposeViewController is always sent from the user's default address.
User's default address is selected by default but the user can switch the accounts. Anyway, no way to get this info back into your app.

How can I send email from my application?

I want to attach a video and send email from my application.
I downloaded apples example code MailComposer. I compiled it. I did not get any errors or warnings.
I sent the mail to my mail id. But, I could not see any mail in my inbox. I am working on simulator.
I did not set any senders email id in simulator.
How can I know whether the code is working or not ?
Thank You.
The simulator cannot send email; nor can all devices, as you'll discover if you use the MFMailComposeViewController +canSendMail method—it returns NO if the device doesn't have a mail account set up. To quote the documentation:
You should call this method before attempting to display the mail composition interface. If it returns NO, you must not display the mail composition interface.