reply to thread google-api-ruby-client

北战南征 提交于 2019-12-02 13:08:45

Looking at the source on GitHub for send_user_message shows that it doesn't take a thread_id as a parameter. However the Message class does have it as an attribute.

So perhaps trying this should work:

  service ||= Google::Apis::GmailV1::GmailService.new

  message = RMail::Message.new
  message.header['To'] = params[:gmail][:to]
  message.header['From'] = current_user_google_user_id
  message.header['Subject'] = params[:gmail][:subject]
  message.header['Subject'] = params[:gmail][:subject]
  message.body = params[:gmail][:body]
  message.thread_id = params[:gmail][:thread_id]

  service.send_user_message(
    current_user_google_user_id,
    upload_source: StringIO.new(message.to_s),
    content_type: 'message/rfc822'
  )
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!