Notification preview

153 views
Skip to first unread message

kirill.sysoev

unread,
Jan 18, 2016, 12:25:46 PM1/18/16
to 2600hz-dev
Hi guys,

Decided to take a look at notifications/teletype thing and stumbled.. :)

When I am doing preview of reseller's notification which is not edited yet and expected to be default one, along with sending preview of default message, reseller's template (both parts - html and txt) is being updated (in my case to blank one).

Is it a kind of smart intention I can't get (if I am just testing preview, why would template be updated) or it is misbehavior?    

Regards,
Kirill

PS: 

     My API_String: <<"/v2/accounts/a33e2943eef14c904ff0b65b44ee77fc/notifications/fax_inbound_to_email/preview">>

      My Data:   {[{<<"to">>,{[{<<"email_addresses">>,[<<"m...@mail.ru">>]}]}},{<<"from">>,<<"m...@mail.ru">>},{<<"subject">>,<<"Testing NOTIFICATION">>},{<<"html">>,<<"PGh0bWw+PGJvZHk+PGgzPk5ldyBGYXggKHt7ZmF4LnRvdGFsX3BhZ2VzfX0gUGFnZXMpPC9oMz48dGFibGU+PHRyPjx0ZD5DYWxsZXIgSUQ8L3RkPjx0ZD57e2NhbGxlcl9pZC5uYW1lfX0gKHt7Y2FsbGVyX2lkLm51bWJlcn19KTwvdGQ+PC90cj48dHI+PHRkPkNhbGxlZSBJRDwvdGQ+PHRkPnt7dG8udXNlcn19IChvcmlnaW5hbGx5IGRpYWxlZCBudW1iZXIpPC90ZD48L3RyPjx0cj48dGQ+Q2FsbCByZWNlaXZlZDwvdGQ+PHRkPnt7ZGF0ZV9jYWxsZWQubG9jYWx8ZGF0ZToibCwgRiBqLCBZIFxcYVxcdCBIOmkifX08L3RkPjwvdHI+PC90YWJsZT48cD5Gb3IgaGVscCBvciBxdWVzdGlvbnMgYWJvdXQgcmVjZWl2aW5nIGZheGVzLCBwbGVhc2UgY29udGFjdCAoNDE1KSA4ODYtNzkwMCBvciBlbWFpbCA8YSBocmVmPSJtYWlsdG86c3VwcG9ydEAyNjAwaHouY29tIj5TdXBwb3J0PC9hPjwvcD48cCBzdHlsZT0iZm9udC1zaXplOiA5cHg7Y29sb3I6I0MwQzBDMCI+e3tmYXguY2FsbF9pZH19PC9wPjwvYm9keT48L2h0bWw+">>},{<<"plain">>,<<"New Fax ({{fax.total_pages}} Pages)\n\nCaller ID: {{caller_id.number}}\nCaller Name: {{caller_id.name}}\n\nCalled To: {{to.user}}   (Originally dialed number)\nCalled On: {{date_called.local|date:\"l, F j, Y \\\\a\\\\t H:i\"}}\n\n\nFor help or questions about receiving faxes, please contact support at (415) 886-7900 or email sup...@2600hz.com.">>},{<<"enabled">>,true},{<<"reply_to">>,<<"m...@mail.ru">>}]}

James Aimonetti

unread,
Jan 19, 2016, 1:19:23 PM1/19/16
to 2600h...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

When you start playing with a notification template via Crossbar, we
migrate the default system template into the account's database so any
changes made are reflected locally in that account.

It is strange that the attachments are not migrating along with it.
Can you capture the logs of that request? cb_notifications should have
log lines related to migrating the templates over - perhaps there's an
unreported (to the user) error?
> sup...@2600hz.com.">>},{<<"enabled">>,true},{<<"reply_to">>,<<"mx8@ma
il.ru">>}]}
>
>
- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"If Dialyzer doesn't care, I don't care"

2600HzPDX | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJWnn4iAAoJENTKa+JPXCVg+X4H/RXg10y6XYYGhZV5rbiT8HOr
FKO8r6FQjV24ffhniElhfL76yLVGmtRux1Tl3DWdL4w1q5HdJzNLw/AioxvSsAGX
JLE5F+iYraWMG0GLEwf1nrPLAjmOzOWZxMh6jO9SlMegR+RA4UT8DtWug/BKDEna
UWIaN9I7k1wVRiKX/H/pniuelpho9TdZfMoRvQQaxGQ4N4y9w+odx8XacHHtNsP2
jTjziat8EH+uENKJ2iUd6sD9u/uADAqRS16aT/sZJ82LXmnfnpOeqXfmFS5WEg3I
sUnp+VaIgsbc49i87msXuV6tiU9YjO8wblzq7oqQoxlKHTr7VyJv73W7RDCPyhs=
=NJqn
-----END PGP SIGNATURE-----

Kirill Sysoev

unread,
Jan 19, 2016, 3:55:39 PM1/19/16
to 2600h...@googlegroups.com
Got you

My expectations was to be able to issue preview request just to take a
look what notification will be sent, but still stay synced with default
system template.
In the other words to take a look without changing anything.

Regarding absent attachments during migration.

here is my test request:
https://gist.github.com/anonymous/fe8c09d90dd945d4536a

here are logs: https://gist.github.com/anonymous/081e5ef5ea82e5f05fe2

Here is the doc without attachments appeared:

{
"_id": "notification.low_balance",
"_rev": "1-40048c5eb6a44579dde458926b886931",
"macros": {
"account.name": {
"i18n_label": "account_name",
"friendly_name": "Account Name",
"description": "Name of the account"
},
"account.realm": {
"i18n_label": "account_realm",
"friendly_name": "Account Realm",
"description": "SIP Realm of the account"
},
"account.id": {
"i18n_label": "account_id",
"friendly_name": "Account ID",
"description": "Account ID"
},
"account.language": {
"i18n_label": "account_language",
"friendly_name": "Account Language",
"description": "Account Language"
},
"account.timezone": {
"i18n_label": "account_timezone",
"friendly_name": "Account Timezone",
"description": "Account Timezone"
}
},
"subject": "Account {{account.name}} is running out of credit",
"category": "account",
"friendly_name": "Low Balance",
"to": {
"type": "admins"
},
"from": "no_r...@kz527.onnet.su",
"cc": {
"type": "specified",
"email_addresses": [
]
},
"bcc": {
"type": "specified",
"email_addresses": [
]
},
"pvt_type": "notification",
"pvt_vsn": "1",
"pvt_account_id": "a33e2943eef14c904ff0b65b44ee77fc",
"pvt_account_db": "account%2Fa3%2F3e%2F2943eef14c904ff0b65b44ee77fc",
"pvt_created": 63620453039,
"pvt_modified": 63620453039,
"pvt_request_id": "a97b84aa92aacbbec42c1c8d04457aa5",
"pvt_auth_user_id": "8b81351bc3afaf4c34d67eb799438498",
"pvt_auth_account_id": "b35483a7e18684f4cd5f09eae01a4c0c",
"pvt_is_authenticated": true

James Aimonetti

unread,
Jan 19, 2016, 6:36:30 PM1/19/16
to 2600h...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Does the version in system_config have attachments?
> On 19.01.2016 21:19, James Aimonetti wrote: When you start playing
> -- James Aimonetti Lead Systems Architect / Impressionable
> Scallywag "If Dialyzer doesn't care, I don't care"
>
> 2600HzPDX | http://2600hz.com sip:ja...@2600hz.com
> tel:415.886.7905 irc:mc_ @ freenode
>>
>

- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"If Dialyzer doesn't care, I don't care"

2600HzPDX | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJWnsh0AAoJENTKa+JPXCVgtCkIAI9CJ8vOVclPRXAyQtWFUKFF
rEhDdJyAHXE0/xTEjqQKb97mMDSEZd+R+ot/M8PkXjE2JuwWQJPhqSdGg+WD3cVp
vY5CKVh92ibO6HrSU+8KdaNlN3AQE7m5ldrzgYmHlinDjUQW3AEQuTxSWvokHpHK
pGRczQREKmCCw8lDRtsPDWrWtz4qPcNCze2unGIa0xyvJrC8NT0nflSOTdDpD4yj
QNyPkLsdbV2bMx+mUufcqS5gOetwfPrcD1eaDxZBBza//4+DADMJydw65lSuGmWf
quc+jDoPTpd6uAJwkGhObYH/BNuMq4HV/fn2OeNfdKVkCLUJjqF4HQtsPGqdDgQ=
=ekid
-----END PGP SIGNATURE-----

Kirill Sysoev

unread,
Jan 20, 2016, 8:44:08 AM1/20/16
to 2600h...@googlegroups.com
Yes, it has.

Screenshot of attachment attached :)
low_balance.png

Matt - nurango (VCCS)

unread,
Nov 14, 2016, 12:52:23 PM11/14/16
to 2600hz-dev
Hey Krill, I wanted to ask if you had any issues with end users receiving low balance alerts? For a week now I have been troubleshooting the template and app sending low balances. So far they only reach the Master account although the "to" field specifies admins. The admins of the accounts. Ive ensured the template is correct and kazoo debug shows the master account template being pulled and the sysconfig version if the master template is removed... Its a different issue but wanted to know if you had seen the same before?

Thanks ahead of time.

Matt

Kirill Sysoev

unread,
Nov 14, 2016, 1:15:36 PM11/14/16
to 2600h...@googlegroups.com
Hi Matt,

Can't help you with this unfortunately.
I'm still using 3.22 in prod with notifications switched off since this stuff is handled by third party billing.

Hopefully I'll move to Kazoo billing/notifications/etc.. after 4.0 migration and will be more helpfull. :)

Regards,
Kirill
--
You received this message because you are subscribed to the Google Groups "2600hz-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

VCCS Portal

unread,
Nov 14, 2016, 1:30:07 PM11/14/16
to 2600h...@googlegroups.com
Thanks anyway. I am on 3.22 myself and testing the install of 4 when I have down time. Best of luck to us both on the migration process! Looks really cool though.

Thanks again,

Matt

To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "2600hz-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/2600hz-dev/DAt01OmT7Ms/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 2600hz-dev+unsubscribe@googlegroups.com.

Matt - nurango (VCCS)

unread,
Nov 16, 2016, 10:57:00 AM11/16/16
to 2600hz-dev
Since @james is really the goto on this, I am wondering if you would make any suggestions please James. I'm starting to think it might be a bug in 3.22.65

notify_low_balance.erl is pretty straight forward as is the template rendering process; 

Check AccountID for notify template, if not account is mute and check parent (although notify templates are not created on prvt client account creation). 
If not check master.
If not check sys config

So I have played with adding and removing the template in the various places and I can only receive the low balance email to the Master email which is the accounts reseller. I have also tried changing the "To" to original instead of admin in case but the code is clear that it checks for the AccountID Billing email. Despite this being set and the attempt to lookup the client account email.

inserted origin pointers for {couch_util,<<"{client account id}">>,<<"notification.low_balance">>} 
and
finding admin email for reseller of account {client ID} (although this should be just a CC)

Any ideas or should I got ahead and file a bug report maybe?

Thank's ahead of time. 

matt


On Monday, January 18, 2016 at 12:25:46 PM UTC-5, kirill.sysoev wrote:

Luis Azedo

unread,
Nov 16, 2016, 11:00:12 AM11/16/16
to 2600h...@googlegroups.com
Hi Matt,

before filling the bug, make sure you tested 3.22 branch (not release).
there were some issues with compiling and previewing templates that were solved with https://github.com/2600hz/kazoo/pull/2760

Best


--

Matt - nurango (VCCS)

unread,
Dec 20, 2016, 1:21:55 PM12/20/16
to 2600hz-dev
Sorry Luis, I appreciate the reply I thought I had updated already.

The fixes did help some templates going to admin but in the end, the low balance email only goes to the reseller and not the end user. The notify setting is "admin" how ever not the account admin. Although this behavior makes sense in the event of the security with double top-up in one day, some end users dont have auto topup enabled and just want to receive a notice when they are low. 

Not sure if this is intentional still but I would see how a reseller wouldnt want his users getting LB emails but master would. The conclusion being, customers need to have a card on file with auto topup or they're sol.

thx again!


On Monday, January 18, 2016 at 12:25:46 PM UTC-5, kirill.sysoev wrote:

Matt - nurango (VCCS)

unread,
Dec 21, 2016, 9:20:22 PM12/21/16
to 2600hz-dev
It was late.. actually since end users can set their own top-up balance threshold this does in fact look like a bug to me.. will post back
Reply all
Reply to author
Forward
0 new messages