Lumail - The console email client


Lua primitives: on_get_body()

NOTE: Lumail-legacy has been superseded by Lumail 2.x, which has a wholly unified Lua API.

If you define the function on_get_body it will be invoked and the return value used as the message-body to display.

By default, in the absence of any filters, Lumail will display the first text/plain part of a message. Using this function you can override that.

For example:

--
-- This is called to get the body of the message to display.
--
-- Here we concatenate *every* text/plain part of the message.
-- Or return an empty string.  Which will result in the normal
-- parsing.
--
function on_get_body()
   parts = get_body_parts()

   result = ""

   for index,type in ipairs( parts ) do
      if ( type == "text/plain" ) then
         result = result .. get_body_part( index )
      end
   end

   return( result )
end

Availability

This function has been available since version 0.20.

See Also

See also on_read_message.