【问题标题】:is there a limit for the characters in text.erb?text.erb 中的字符有限制吗?
【发布时间】:2017-06-01 01:36:43
【问题描述】:

我正在学习 rails 并创建一个 confirmation.text.erb 以从我的示例应用程序发送文本通知。如下所示:

Hi <%= @user_detail.outputs[0][0] %>, We noticed you havent paid your cable bill. you total remaining is <%= @user_detail.outputs[0][1] %>. You can pay bill online or visit the nearest cable center.

但是当我的手机收到短信时,我只看到Hi &lt;%= @user_detail.outputs[0][0] %&gt;, We noticed you havent paid your abc bill. you total remaining 部分。为什么它不发送完整的文本?

UserMailer 如下所示

class UserMailer < ApplicationMailer

  def payment_confirmation(user_detail)
    @user_detail = user_detail
    mail from: "no-reply@cerner.com", 
          to: '1112223333@messaging.sprintpcs.com', 
          subject: 'Payment notification'
  end
end

谢谢

【问题讨论】:

  • 邮件方法是什么样的?
  • 使用邮件方法更新问题
  • 现在,user_detail 是什么样的? :)
  • #<:response:0x007fe6d5897a38>>

标签: html ruby-on-rails ruby-on-rails-4 erb


【解决方案1】:

不,您遇到的字符限制很可能是您使用的电子邮件-短信网关。标准 SMS 限制为 160 个字符,较长的消息需要使用 MMS,但网关可能只是截断了消息。

【讨论】:

  • 谢谢。我还有其他方法可以完成这项工作吗?
  • @User7354632781 Google 告诉我,至少有一次 Sprint 有一个单独的 MMS 网关,位于 number@pm.sprint.com。由于我在另一个网络上,我无法对此进行测试。
猜你喜欢
  • 2010-10-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-11
  • 2018-07-08
相关资源
最近更新 更多