#1 2020-11-11 18:07:26

unsi_2
Member
Registered: 2020-06-24

send to hook

hi

i have made a hook that sends reports by email, but i would need this code snippets if possible:

- a form like the one in the current sento email option, that allows the user to choose a recipient from a list of users. his mail address appears by default.

- a second simpler option, although less functional, would be to predefine the user email in an input box, and the user could change it

do you have a sample of any of the two?

kind regards

Offline

#2 2020-11-17 13:19:31

unsi_2
Member
Registered: 2020-06-24

Re: send to hook

i have been able to accomplish the second option, but it would be nice to have the first one: a selection of users like the sento mail.

also, when popping the form it appears in a strange way, out of the actual content, instead to floating in the center:

def callback = [
  consumes : { report ->

    def config = new SendToClientConfig();
    config.setTitle("....");
    config.setIcon(".....");
    config.setSelectFormat(true);
    def user = GLOBALS.getRsService(AuthenticatorService.class).getCurrentUser();
config.setForm("""   
    {
     "width": 600,
        "height": 500,
        "form" : {
                "labelAlign": "left",
                "fields": [{
                        "id": "email",
                        "type": "string",
                        "label": "Email Address",
                        "value":"""+"\""+ user.getEmail()+"\""+"""
                       
                       
                          }]
                 }
    }
""")
    return config;

Offline

Board footer

Powered by FluxBB