Search code examples
phpemailpodio

How can I get the email to comment in any item as the app in Podio?


Doing tests to get the email url and reviewing the documentation: https://developers.podio.com/doc/applications/get-area-22349 I get a response with data similar to this one:

"mailbox": The mailbox to use when mailing to the app,

It has the app id to sent mail…

  • "url_label": "urlLabelResponse",
  • "app_id": 11111111,
  • "name": "appNameResponse",
  • "item_name": "itemNameResponse",

  • "status": "active",
  • "default_view_id": null,
  • "mailbox": "appname.2f2f2f2f",
  • "is_default": false,

It has the hex value: 2f2f2f2f and reviewing the action , it uses a hex number within the mail itself. This is the only “mailbox” mention so far and reviewing carefully the email, it looks like:

2.6d8248d7@appName.workspacename.organizationname.podio.com

so, the order is:

intNumber.HexNumber@appName.workspacename.organizationname.podio.com

I assumed the hex was the same within the app, and in my review, I realized the int number in the email, corresponds to the item id.

BUT… the hex number is different for EVERY SINGLE ITEM.

So, with (lets say, for example) the following data:

  • App ID: 77665544

I get the mailbox: "mailbox": "name.9f999999", And different items looked like:


  • Item ID: 735447534
  • App ID: 77665544
  • Workspace ID: 4444444
  • Item e-mail: 3.1fd9a0b2@appName.workspacename.organizationname.podio.com


  • Item ID: 731589225

  • App ID: 77665544
  • Workspace ID: 4444444
  • Item e-mail: 2.f91aa7f4@appName.workspacename.organizationname.podio.com


  • Item ID: 733288208

  • App ID: 77665544
  • Workspace ID: 4444444
  • Item e-mail: 1.3bfa5531@ appName.workspacename.organizationname.podio.com

So, the biggest issue is to get the item email, or the hex in the email, is there any dev way to get it?

I tried in several ways without success, any help will be appreciated Also in the review: https://help.podio.com/hc/en-us/articles/201290603-Email-to-item?mobile_site=true https://blog.podio.com/2013/12/12/email-to-item/?_ga=2.57372202.1222208225.1510587163-1885911191.1491422608 https://help.podio.com/hc/en-us/community/posts/200509658--Google-Apps-Add-e-mail-as-item-not-as-a-task


Solution

  • You can't guess email-to-app email address or email-to-item email. That hex value that you've seen is generated randomly for each app and item. Luckily, you don't need to guess it at all because there is api call that will return that info.

    Here are all details for api method you are looking for: https://developers.podio.com/doc/email/get-email-contact-for-reference-13716555

    For email-to-item case: name would be item_comment_user and ref_type would be item and ref_id is item_id.