[xwiki-users] Error on sending emails (listener)
Hello People, I have codified a listener that are listening actions of creation and edition of the page, in "on event" method I send an email to specifics users. When I create a page the listener works well and the email is sent, however when I update the page, the xwiki returns me the following error: 2014-03-12 14:43:20,841 [http://wiki.scl.corp/bin/view/Blog/Publisher?entryName=Blog+de+Processos.Suc...] ERROR c.x.x.p.m.MailSenderPlugin - No mail object found in the document MailTemplate : Aviso de Publicacao Post The funny is that the same Mailtemplate and code is used for both kind of events. I am using the a listener based on this one: http://platform.xwiki.org/xwiki/bin/download/DevGuide/GroovyNotificationTuto... Any idea? Danilo Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately.
Just to add the my method sendMessageFromTemplate is returning "-2" when I get error and "0" when I get success. {{code}} def result = xwiki.mailsender.sendMessageFromTemplate("${senderemail}", recipient, emailcc, emailbcc, "pt_BR", "MailTemplate : Aviso de Publicacao Post", map) {{/code}} Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately. -----Mensagem original----- De: users [mailto:[email protected]] Em nome de Danilo Amaral de Oliveira Enviada em: quarta-feira, 12 de março de 2014 14:50 Para: XWiki Users Assunto: [xwiki-users] Error on sending emails (listener) Hello People, I have codified a listener that are listening actions of creation and edition of the page, in "on event" method I send an email to specifics users. When I create a page the listener works well and the email is sent, however when I update the page, the xwiki returns me the following error: 2014-03-12 14:43:20,841 [http://wiki.scl.corp/bin/view/Blog/Publisher?entryName=Blog+de+Processos.Suc...] ERROR c.x.x.p.m.MailSenderPlugin - No mail object found in the document MailTemplate : Aviso de Publicacao Post The funny is that the same Mailtemplate and code is used for both kind of events. I am using the a listener based on this one: http://platform.xwiki.org/xwiki/bin/download/DevGuide/GroovyNotificationTuto... Any idea? Danilo Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Solved Error. I found the code of sendemail plugin (https://github.com/xwiki/xwiki-platform/blob/b6abb2ee5a67f3495bfeb3fed93e609...) and I figured out the exception that I was getting BaseObject obj = doc.getObject(EMAIL_XWIKI_CLASS_NAME, "language", language); if (obj == null) { obj = doc.getObject(EMAIL_XWIKI_CLASS_NAME, "language", "en"); } if (obj == null) { LOGGER.error("No mail object found in the document " + templateDocFullName); return ERROR_TEMPLATE_EMAIL_OBJECT_NOT_FOUND; } The Mail template was not being found.... After to put the space of the document the email worked to both kind of events. So instead of MailTemplate : Aviso de Publicacao Post I replaced with "Space. MailTemplate : Aviso de Publicacao Post" Everything stay easier when you have access to the code =) Sorry for bothering you... Danilo Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately. -----Mensagem original----- De: users [mailto:[email protected]] Em nome de Danilo Amaral de Oliveira Enviada em: quarta-feira, 12 de março de 2014 15:01 Para: XWiki Users Assunto: [xwiki-users] RES: Error on sending emails (listener) Just to add the my method sendMessageFromTemplate is returning "-2" when I get error and "0" when I get success. {{code}} def result = xwiki.mailsender.sendMessageFromTemplate("${senderemail}", recipient, emailcc, emailbcc, "pt_BR", "MailTemplate : Aviso de Publicacao Post", map) {{/code}} Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately. -----Mensagem original----- De: users [mailto:[email protected]] Em nome de Danilo Amaral de Oliveira Enviada em: quarta-feira, 12 de março de 2014 14:50 Para: XWiki Users Assunto: [xwiki-users] Error on sending emails (listener) Hello People, I have codified a listener that are listening actions of creation and edition of the page, in "on event" method I send an email to specifics users. When I create a page the listener works well and the email is sent, however when I update the page, the xwiki returns me the following error: 2014-03-12 14:43:20,841 [http://wiki.scl.corp/bin/view/Blog/Publisher?entryName=Blog+de+Processos.Suc...] ERROR c.x.x.p.m.MailSenderPlugin - No mail object found in the document MailTemplate : Aviso de Publicacao Post The funny is that the same Mailtemplate and code is used for both kind of events. I am using the a listener based on this one: http://platform.xwiki.org/xwiki/bin/download/DevGuide/GroovyNotificationTuto... Any idea? Danilo Grupo Energisa Danilo A. Oliveira Analista Suporte Aplicacao TI - DPTO CORP. DE INFRAESTR. TI e-mail: [email protected] | tel: (32) 3429-6342 | cel: (32) 8452-9478 Esta mensagem contém informação confidencial. Se você a recebeu por engano, não divulgue ou copie seu conteúdo. Por favor, avise ao remetente imediatamente e apague-a do computador. Privileged and confidential. If this message has been received by mistake, do not disclose or copy its contents. Please notify sender and delete immediately. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (1)
-
Danilo Amaral de Oliveira