WebWrapper data type

Official Content
This documentation is valid for:

Deprecated: Since GeneXus 15.

WebWrapper is a GeneXus data type that allows to encapsulate Web objects execution (the generated HTML code), and process it as desired. In particular, you can send a Web Panel object via e-mail using this feature. 

One way of sending a Web Panel via e-mail from a GeneXus object is by defining a WebWrapper type variable.

The main idea is to capture the contents of the Web Panel (its HTML code) and send it via e-mail. Thus, it must be noted that the mail client receiving the e-mail must have the capacity to interpret the HTML language.

Properties

BaseUrl property
Object property

Methods

GetResponse Method

 

Any event produced in the Web Panel making a post to the server (e.g.: clicking on a button, releasing a procedure, etc.) will cause the Web Panel to be opened in the browser, in the address specified in the  BaseUrl property

Images in Web Panel sent via e-mail

There are two ways of including images in the webwrapper:

  • Including the images in the Web Panel as an absolute URL. The disadvantage of this option is that the user must be online the moment he is reading the mail. By adding the image as external, you can specify an absolute reference to it. See 
    Image object
    .
  • Including relative images in the Web Panel and sending them as an attachment to the e-mail.
    In this case, the image route must not include directories (i.e. /imagines/logo.jpg); it only has to make a direct reference to it  (i.e. logo.jpg).

Example

Event SendMail
    &DirTo.Address = 'jhon@yahoo.com'    
    &DirTo.Name = 'Jhon Smith'
    &mailmsg.To.Clear()
    &mailmsg.To.Add(&dirto)
    &mailmsg.Subject = 'GeneXus News'
    &SMTPSession.Host = &host
    &Sender.Address = 'GeneXus'
    &Sender.Name = 'GeneXus'
    &SMTPSession.Sender = &Sender
    &RetCode = &SMTPSession.Login()
    &Wrap.Object = Create(SearchStudents)
    &infoContent = &Wrap.GetResponse()
    &MailMsg.HTMLText = &infoContent
    &SMTPSession.Send(&MailMsg)
    &smtpsession.Logout() 
EndEvent  // SendMail




Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.