Vtiger CRM change event notification email template - vtiger

where i can change the email notification template to inform users.
no i hae template like this:
User Name,
Meeting with user Name
29-04-2016 2:30 PM (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
9-04-2016 2:35 PM (UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
Planned
Localization:
Administrator.

There is no inbuilt template defined in CRM to send the reminders / notifications of meetings. You have to customize the things as per below:
Open \modules\Calendar\CalendarCommon.php
Search function getActivityDetails(
You will find email body text has been written in $list variable. Modify the template content as per your need and save the file.
Hope it will helps to you. Cheers!

Related

Allowing users to only view data related to them in Apache Superset

I have some information related to different vendors in my database and I want to allow each registered vendor (representative person) to view slices/dashboards which contains only data related to them.
One possible solution could be to create separate views for each vendor as well as separate roles for each vendor. But it feels like a bad idea if you have 100+ vendors (as is my case); and it's not a flexible or scalable solution.
Is there some way to automatically filter a given view for each user? For example, we have a "general profit by product" bar chart, and user X can see only products of vendor X
What you're looking for is multi-tenancy support, and this is not currently supported out-of-the-box in Superset.
There is however an open PR for one possible solution: https://github.com/apache/incubator-superset/pull/3729
One option could be to re-use and/or adapt that code for your use-case.
Another option might be to look into JINJA_CONTEXT_ADDONS [https://github.com/apache/incubator-superset/blob/master/docs/installation.rst#sql-lab] and see whether you might be able to pass additional context to your query (e.g. your vendor_id) and restrict the scope of your query using that parameter.
Superset config has the below two configurations(DB_CONNECTION_MUTATOR, SQL_QUERY_MUTATOR), which can allow for multi-tenancy to an extent.
A callable that allows altering the database conneciton URL and params
on the fly, at runtime. This allows for things like impersonation or
arbitrary logic. For instance you can wire different users to
use different connection parameters, or pass their email address as the
username. The function receives the connection uri object, connection
params, the username, and returns the mutated uri and params objects.
Example:
def DB_CONNECTION_MUTATOR(uri, params, username, security_manager, source):
user = security_manager.find_user(username=username)
if user and user.email:
uri.username = user.email
return uri, params
Note that the returned uri and params are passed directly to sqlalchemy's
as such create_engine(url, **params)
DB_CONNECTION_MUTATOR = None
A function that intercepts the SQL to be executed and can alter it.
The use case is can be around adding some sort of comment header
with information such as the username and worker node information
def SQL_QUERY_MUTATOR(sql, username, security_manager):
dttm = datetime.now().isoformat()
return f"-- [SQL LAB] {username} {dttm}\n{sql}"
SQL_QUERY_MUTATOR = None
One easy way of solving this problem is by using pre-defined JINJA parameters.
Two parameters that can be used are '{{current_username() }}' and {{current_user_id() }}
First you need to ensure that you can use JINJA templates -
In superset_config.py add the following
FEATURE_FLAGS = {
"ENABLE_TEMPLATE_PROCESSING": True,
}
Restart
Now if you go to the SQL LAB and type the following -
SELECT '{{ current_username() }}',{{ current_user_id() }};
You should get an output
?column?
?column?__1
PayalC
5
Now all you have to do is append one of the two following sql snippet in all your queries.
select ........ from ...... where ...... vendorid={{ current_user_id() }}
select ........ from ...... where ...... vendorname='{{ current_username() }}'
vendorid={{ current_user_id() }} and/or
vendorname='{{ current_username() }}' will restrict the user to view only her data.
You could also make it more flexible by creating a table which has a mapping of user to vendorid. That table can be your added to all the queries and you could map multiple vendors to a single user or even all vendors to a single user for a super admin.

Sitecore EXM creating contact list via importing csv

I have recently came across scenario where I need to create list via importing csv file. I have few queries to understand how it works
Does importing csv creates contact for each record in csv?
If yes what is the default contact identifier (Name or email)?
Importing contacts for EXM is done by using the List Manager module from Sitecore and there are two ways to import contacts:
Import contacts to the contacts database.
Import contacts and add them to a new Contact list.
When you import contacts from a CSV file, the List Manager allows you to manually map the fields, including the unique indentifier, based on which Sitecore will create a new contact or update an existing.
It's recommended to have a strategy when building this unique identifier, like contact's date of birth or zip code in combination with the first name rather than email address - as a person can have multiple email addresses and it might end up having multiple entries in your contacts database.
So to answer your question, Yes - the List Manager will create a new contact if it doesn't find a match based on the Indentifier you provide. The default identifier is the email address.
Official guideline from Sitecore
Import and export contacts from a list
https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/the_list_manager/creating_lists/import_and_export_contacts_from_a_list
Important
List Manager uses the contact identifier to identify the contacts in your database and to ensure that unnecessary duplicates are not created when you import new contacts. Therefore, before you import a list of contacts, it is important that you create a strategy for the contact identifier. For example, if you use the contact's date of birth or zip code in combination with the first name, this makes a more suitable contact identifier than an email address alone. Using the email address as the contact identifier can result in a contact appearing multiple times in the database if they have more than one email address.
How to add a contact to a list
https://doc.sitecore.net/sitecore_experience_platform/digital_marketing/the_list_manager/creating_lists/add_a_contact_to_a_list
If you do not want to use the email address as the contact identifier, select the Manually map contact identifiers check box and then as the Identifier, select the field in the import file that you want to use as the unique identifier for the contacts.

Opencart 1.5.x (may be 2.0), how to put first/last name on any template (not registered user)

Checkout page.
Not registered user.
I need to put first/last user name on custom template (this is custom payment tpl of some small bank).
I now, how do it for registered users, it is easy:
$this->data['firstname'] = $this->customer->getFirstName();
But how to do it for not registerd user?
I can't put first/last name.
Presumably your template will only be displayed after they have placed their order but the order is still in the session?
If this is the case, you can get their details from the payment details (or shipping details depending on which one you want) in the session cookie.
So it would be something like:
$this->data['firstname'] = $this->session->data['guest']['payment']['firstname'];
This is true too:
echo ($this->data['firstname'] = $this->session->data['guest']['firstname']);
echo ($this->data['lastname'] = $this->session->data['guest']['lastname']);
echo ($this->data['email'] = $this->session->data['guest']['email']);
echo ($this->data['telephone'] = $this->session->data['guest']['telephone']);

what is the difference between django html_message and message in send mail

When im trying to send a mail with django send mail only the html message is coming and not the normal message i want to know the difference between both.
Is there any best way to send mails through template or html files because i want a comming mailing system in my app.
Note:- the difference is of more important.
THIS IS WHAT I DID
msg_html = (' HELLLOOOOO')
msg_plain = 'Normalallalaa
send_mail("titleeeee", msg_plain,"sender#test",["reciever#tese",],html_message=msg_html)
My mail contained only Hello in bold
Where did my message go.
The problem is that some (old or specifically configured) email clients won't display HTML messages, therefore you need to make sure all your users can read your emails properly. If you decide to send just text, then users capable of getting HTML messages won't benefit from it.
This is the strategy I follow:
I use django.template.loader.render_to_string to render a template with a given context. The value this function returns is a string with a message in HTML.
html_text = render_to_string(template, context)
Then I create a plain text message based on the HTML message (for instance, by using a package named html2text):
plain_text = html2text(html_text)
And finally I send the email with django.core.mail.send_mail, passing html_text and plain_text as parameters.
Message is plain text, while html_message is a message formatted using HTML. If you set both, probably your email client is displaying the HTML version.

Load dynamic HTML to display custom template

I own a small website that display to the users an html template (with css). Each user can change the template (customizable).
By default i have a template i copy everytime to a new user or if i get nice template (high rates) users can choose it.
instead of copying the template over and over, is there an easy way for me to create 1 template and then when the page load, it shows on the user page and then he can interact (ajax calls, href links etc...)
for example:
new user logged for the first time, the "user license agreement" shows then he click accept and his page shows up. this "home" page has forms, links, images etc... using a default template. that is the one i want to load dynamically instead of copying this template to each users.
why: i found HTML error in the page and now i need to copy this template to 127 users ... which is a pain.
i am using LAMP
thanks
yes using jQuery!
$('#divID').load('pathToHTMLTemplate') is your answer as long as you have the html file stored on same domain :)
This will fetch the html template using ajax and append its content to the div you want. It can also be 'body'.
Here is the documentation which should tell you everything you need to.
Once the template is loaded you can load the user specific data using ajax or any app server you are using. .load function provides a callback:
$('#divID').load('pathToHTMLTemplate', function(){
// now the template is loaded and you can maniupulate it further or load user specific data
});
It sounds to me (just going off of your post) that you have a directory somewhere with a bunch of files "user1.html", "user2.html" or something similar. All of these are either the same or similar, since they're basically the same template.
My recommendation:
Have a database table (or a flat file, but I recommend a database table) that maps a user ID (or name, however you have them arranged) to a template. For example, if user1 and user2 use template_default.html, but user3 uses template_popular.html, you would have the following in your database:
name|template
user1|template_default.html
user2|template_default.html
user3|template_popular.html
Then in whatever code is currently deciding which page to show the user, change it to pull the user's chosen template out of the database and display that instead. So then you only have 1 or 2 pages instead of 127.
If the user is allowed to make edits to their template, that could be stored as metadata in the table as well, then you could use substitution parameters to add it into the template.
Example:
MySQL table:
CREATE TABLE user_templates (
`user` varchar(100),
template varchar(100)
);
Upon receiving a new user:
INSERT INTO user_templates(`user`,template) VALUES("<username>","default_template.html");
Upon user choosing a new template:
UPDATE user_templates set template = "<new template>" WHERE `user` = "<username>";
Upon user loading the user's page (this done in php):
$template = "default_template.html";
$query = "SELECT template FROM user_templates WHERE `user` = \"" . mysql_real_escape_string($username) . "\"";
$result = mysql_query($query,$databaseHandle);
if ($result && mysql_num_rows($result) > 0) {
$template = mysql_result($result,0,"template");
}
// 1st way to do it
$pageToLoad = "http://www.someserver.com/templates/$template";
header("Location: $pageToLoad");
// 2nd way, if you want it embedded in a page somewhere
$directory = "/var/www/site/templates/$template";
$pageContents = file_get_contents($directory);
print "<div id=\"userPage\">$pageContents</div>";
I assume you mean that you have an HTML file that is customized for each user (look, feel, etc):
User1-theme.html
User2-theme.html
User3-theme.html
User4-theme.html
User4-theme.html
Then you would have a file that has all of your ajax calls, links, etc that you want for each user:
User-Controls.html
What you need to do is
Ensure jQuery is downloaded and included on each of your User Theme Pages.
Add this code snipplet to each of your User Theme Pages:
$("#myDiv").load("User-Controls.html")
(where #myDiv is the div ID on the template page that you want to load the controls into
and User-Controls.html is the path to the html file containing the controls you want to load