如何确保 MFMailComposeViewController 当正文不为空时不发送电子邮件?
我的应用程序中有 MFMailComposeViewController,以便用户可以轻松地通过电子邮件向我发送关于应用程序的建议和反馈,但我每天收到大约 3 封电子邮件,其中正文为空或只有用户电子邮件签名。
在使用 MFMailComposeViewController 发送电子邮件之前,有什么方法可以检查电子邮件正文是否不为空?
I have MFMailComposeViewController in my app in order to allow the user easily email me about suggestions and feedback on the app but I get about 3 emails a day which are just empty in the body or just the users email signature.
Is there any way of checking if the body of an email is not empty before it is sent with MFMailComposeViewController?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这不是一个编程答案,可能有点偏离主题,但我已经发布了一些具有类似功能的应用程序,并且看到了同样的事情。
我也和一些发送空邮件的用户交谈过,了解到有时他们只是尝试一下应用程序的各种功能,有时他们会进入反馈页面,但不想接受在手机上输入电子邮件的时间。
我认为这更多的是一个客户服务问题,而不是一个编程挑战。我会利用这个机会跟进发送空电子邮件的用户。 (至少现在你有了他们的电子邮件 - 如果你不让他们发送没有正文的表格,你可能永远不会收到它。)一种选择是发送一封标准的后续电子邮件,表明你收到了他们发来的空电子邮件并希望听到他们对您的产品的反馈。 (也许甚至可以向他们发送一份快速调查)。
This is not a programming answer, and might be a bit off topic, but I have released a few apps with similar functionality, and have seen the same thing.
I have also talked with a few of the users who have sent in empty emails, and have learned that sometimes they sere just trying out the various functions of the App, and sometimes they get to the feedback page, but don't want to take the time to type out an email on their phone.
I would think of this as more of a customer service problem, and less of a programming challenge. I would use the opportunity to follow up with the users who send the empty emails. (At least now you have their email - if you don't let them send the form without a body you will likely never get it.) One option is to send a standard follow-up email that says you received an empty email from them and would love to hear their feedback on your product. (Perhaps even send them a quick survey) .
一旦显示了 MFMailComposeViewController 的视图,您就无法获取消息或控制行为。你无法阻止人们发送空邮件。
如果你真的想这样做,你将不得不编写一个替换视图和控制器。不过,在接收端过滤空白邮件可能更容易:-)
Once you have displayed the MFMailComposeViewController's view you cannot get at the message or control the behaviour. You cannot stop people sending empty mails.
If you really want to do this you will have to write a replacement view and controller. It is probably easier to filter the blank mails at the receiving end though :-)