Is it possible to send custom reports as HTML?




I'm currently using the message sender object from within custom Python scenario, but so far I can only send plain text messages. Is it possible to use HTML formating rather than plain text with this feature? I can't find the complete list of parameters for these functions in the documentation :

  
  

```
  
message\_sender.set\_params(sender="dss@company.com", recipent="data-scientists@company.com")  
message\_sender.send(sender="", recipient="", subject="", message="")
```
  
  
Thanks a lot!

  
  
Romain
Hi Romain, 

  
  
You can use HTML formatting this way:

  
  

```
  
sender = scenario.get_message_sender(channel_id="my_channel_id")   
sender.set_params(sender="dss@company.com",   
                recipient="your.email@company.com",   
                sendAsHTML=True)  
                  
html_message="<b>All is good</b>"  
  
sender.send(subject="The scenario is doing well",   
            message=html_message)
```
  
  
 




[View solution in original post](/t5/Using-Dataiku/Is-it-possible-to-send-custom-reports-as-HTML/m-p/2194#M1517)
In the server configuration document, in the Router/SMTP section, tab Restrictions and controls|SMTP Outbound controls, there is a parameter ‘Allow messages only from the following Notes addresses to be sent to the Internet:’. List the allowed names there, to prevent the others from sending mail to the Internet. Let's say in your `settings.py` file you have:



```
SITE_URL='www.mydomain.tld/somewhere/'
SITE_NAME='My site'

```

**If you need that in just one or two views:**



```
from django.shortcuts import render_to_response
from django.conf import settings

def my_view(request, ...):
    response_dict = {
        'site_name': settings.SITE_NAME,
        'site_url': settings.SITE_URL,
    }
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

```

**If you need to access these across a lot of apps and/or views, you can write a context processor to save code:**


James has a tutorial on this 
[online](http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/).


Some useful information on the when and if of context processors is available on this very site 
[here](https://stackoverflow.com/questions/831301/when-is-it-appropriate-to-use-django-context-processors).


Inside your `my_context_processors.py` file you would:



```
from django.conf import settings

def some_context_processor(request):
    my_dict = {
        'site_url': settings.SITE_URL,
        'site_name': settings.SITE_NAME,
    }

    return my_dict

```

Back in your `settings.py`, activate it by doing:



```
TEMPLATE_CONTEXT_PROCESSORS = (
    ...

    # yours
    'my_context_processors.some_context_processor',
)

```

In your `views.py`, make a view use it like so:



```
from django.shortcuts import render_to_response
from django.template import RequestContext

def my_view(request, ...):  
    response_dict = RequestContext(request)
    ...
    # you can still still add variables that specific only to this view
    response_dict['some_var_only_in_this_view'] = 42
    ...
    return render_to_response('my_template_dir/my_template.html', response_dict)

``` Not being a SP user, here's my 2 cents worth:  AFAIK both Frameless and HTML5 are in HTML5. I think though, that if you indicate your output is going to SP to be hosted there, that you end up with .aspx output.  That's governed by what access your SP administrator grants people. Correct. Generally you don't want to be messing around with your output after generating if you can help it. The edit, generate, publish cycle is designed to be minimally disruptive - usually just refreshing the "co... can you be a little more precise ? does your send message work corretctly if sent from main procedure ? if yes do you uses qmhsndpm ? who is the receiver (call stack entry) (I suppose it’s ‘*’) ? what level in the stack (call stack count)(I suppose it’s 2 ) ?





A message subfile displays the messages from a program message queue — that’s what they’re for. Normally, they’re linked to the name of the program that displays the message subfile (i.e., displays the display file).


Send a message to the program message queue that’s associated with the message subfile.


Tom We love hearing from itcher users. Click the menu icon and choose 'Send feedback' within the respective menu, complete the details, and hit send. Alternatively, you can always send us an email at [[email protected]](/cdn-cgi/l/email-protection#45262a2b31242631052c31262d20376b262a28). from here [fstrm python receiver](https://github.com/dmachard/python-framestream/blob/main/fstrm/fstrm_codec.py)

# frame streams control frame format - data frame length equals 00 00 00 00

# |||

# | data frame length | 4 bytes |

# ||… Please create an account and send us a private message with the detailed project requirements here -> <https://cpentalk.com/message/cpentalk>  
  
Best regards! JavaScript *itself* has nothing built in for handling query string parameters. 


Code running in a (modern) browser you can use the [`URL` object](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) (which is part of the APIs provided by browsers to JS):





```
var url_string = "http://www.example.com/t.html?a=1&b=3&c=m2-m3-m4-m5"; //window.location.href
var url = new URL(url_string);
var c = url.searchParams.get("c");
console.log(c);
```









For older browsers (including Internet Explorer), you can use [this polyfill](https://github.com/ungap/url-search-params) or the code from the original version of this answer that predates `URL`:


You could access `location.search`, which would give you from the `?` character on to the end of the URL or the start of the fragment identifier (#foo), whichever comes first.


Then you can parse it with this:





```
function parse_query_string(query) {
  var vars = query.split("&");
  var query_string = {};
  for (var i = 0; i < vars.length; i++) {
    var pair = vars[i].split("=");
    var key = decodeURIComponent(pair[0]);
    var value = decodeURIComponent(pair[1]);
    // If first entry with this name
    if (typeof query_string[key]  "undefined") {
      query_string[key] = decodeURIComponent(value);
      // If second entry with this name
    } else if (typeof query_string[key]  "string") {
      var arr = [query_string[key], decodeURIComponent(value)];
      query_string[key] = arr;
      // If third or later entry with this name
    } else {
      query_string[key].push(decodeURIComponent(value));
    }
  }
  return query_string;
}

var query_string = "a=1&b=3&c=m2-m3-m4-m5";
var parsed_qs = parse_query_string(query_string);
console.log(parsed_qs.c);
```




You can get the query string from the URL of the current page with:



```
var query = window.location.search.substring(1);
var qs = parse_query_string(query);

``` hi paul,

i believe the financial reporting covers in quite a lot of detail exactly what you are looking for.

from what i can tell you aren’t using templates in your tables…

[[image]](https://forum.enterprisedna.co/uploads/db7134/original/2x/5/559a333f85c159c8d9bec9235ca5c45997d08858.png "image")

if you want to get a certain order and custom table then you really need to use the template approach covered in t… unfortunately it’s not possible currently. i would highly encourage you to create a feedback card in our feedback category:

[feedback](/c/feedback/95)

submit and vote on product feedback and feature requests.