ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

Example Messagent dynamic page with c# 

Categories: .Net Messagent
Website with registration
designer - select a date

<FORM method=post name=silentboxesform action=[$=PROBE(200)/]>
<DIV id=MASECTION contentEditable=true MACONSTRAINT="DATA_ERROR<>''" MASHOWALLLANGUAGES="FALSE">
<B>Kies een datum...</B>
<P>~DYNAMIC_RADIOLIST~</P>
<INPUT style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 78px; BACKGROUND: url(http://messagent.yourinstallation.be/images/Residential/Adhoc/2008/2008-05/silent%20boxes/btn.gif); HEIGHT: 24px; COLOR: #7a7a7a; FONT-SIZE: 9px; BORDER-TOP: 0px; FONT-WEIGHT: bold; BORDER-RIGHT: 0px" value=Verdergaan alt=Verdergaan type=submit>
</DIV>
</FORM>


timeslots.aspx.cs

protected void Page_Load(object sender, EventArgs e)
{
 using (var con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
 {
         con.Open();

                var sbQuery = new StringBuilder();
                sbQuery.Append("select year(dag) as jaar, month(dag) as maand, day(dag) as dag, min(id) as slotid");
                sbQuery.Append(" from timeslots");
                sbQuery.Append(" where fk_user_id is null");
                sbQuery.Append(" and DatePart(hour, dag) < 12");
                sbQuery.Append(" group by year(dag), month(dag), day(dag)");

                bool hasVoormiddag = false;

                using (var cmd = new SqlCommand(sbQuery.ToString(), con))
                {
                    using (var dr = cmd.ExecuteReader())
                    {
                        if (dr != null)
                        {
                            hasVoormiddag = true;

                            Response.Write("Voormiddag : <br />");

                            while (dr.Read())
                            {
                                Response.Write(
                                    "<input type='radio' name='slot' value='" + dr["slotid"] + "' onclick=\"new Effect.BlindDown($('internetDiv'),'blind', {duration:0.3});\" /> " + dr["dag"] + " september");
                                Response.Write("<br />");
                            }
                        }
                    }
                }

                sbQuery = new StringBuilder(); 
                sbQuery.Append(" select year(dag) as jaar, month(dag) as maand, day(dag) as dag, min(id) as slotid");
                sbQuery.Append(" from timeslots");
                sbQuery.Append(" where fk_user_id is null");
                sbQuery.Append(" and DatePart(hour, dag) > 12");
                sbQuery.Append(" group by year(dag), month(dag), day(dag)");

                if (hasVoormiddag) Response.Write("<br />");
               
                using (var cmd = new SqlCommand(sbQuery.ToString(), con))
                {
                    using (var dr = cmd.ExecuteReader())
                    {
                        if (dr != null)
                        {
                            Response.Write("Namiddag : <br />");

                            while (dr.Read())
                            {
                                Response.Write(
                                    "<input type='radio' name='slot' value='" + dr["slotid"] + "' onclick=\"new Effect.BlindDown($('internetDiv'),'blind', {duration:0.3});\" /> " + dr["dag"] + " september");
                                Response.Write("<br />");
                            }
                        }
                    }
                }

            }
}

Website with registration

Default probes and the webversions 

Categories: Messagent

Aantal malen dat op een webversie is geclicked weergeven voor versies onder 3.1.

Probleem:

Van zodra we de campaign starten word er een probe 0 record toegevoegd zonder dat de mail bekeken of aangeklikt is geweest, ook niet in preview. Nadien word er geen enkele probe 0 (webversion) meer geregistreerd.

Workaround :
Op 'email niet leesbaar click hier' zetten wij een PROBE(2000) en dan geven we PROBE(2000) als property een [PROBE(0)] zo kunnen we exact nagaan hoeveel malen er op de webversie geclicked is. En dit door in de FLAGS naar probeid 2000 te querien.
 

Ter informatie :

FLAGS.PROBEID = 0, dat bedoel dat de email is aangeleverd in de mailbox
FLAGS.PROBEID = -1, de email is gezien
FLAGS.PROBEID >= 100, is de ID van de sensor dat de persoon geklickt heeft

Messagent Caching configuration 

Categories: Messagent

Configuring caching on a data component is not possible. It can be done on a higher level, campaign level or mail/page level.

  • CACHE_CAMPAIGNDEF (caching of campaign definition) 
  • CACHE_MESSAGEDEF (caching of mails/pages definition) 
The 'Content Expiration'

This option will only give you the possibility to include articles based on their created date or modified date. You cannot use this to exclude articles.  Still if you want to use this option it's very easy. Just select the field were you want to filter on (created date or modified date) and then select the interval you want. For example 1 Hour.

 

Automatically add users and fields to new list 

Categories: Messagent

/****** We will add a database trigger that will alter the table on creation ******/

USE [DB_MESSAGENT]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE TRIGGER [ddltrg_CREATE_TABLE] ON DATABASE
FOR CREATE_TABLE
AS
SET NOCOUNT ON

DECLARE @data xml
SET @data = EVENTDATA()

DECLARE @objname sysname
SET @objname = @data.value('(/EVENT_INSTANCE/ObjectName)[1]', 'varchar(256)')
--PRINT @objname

IF LEFT(@objname,6) = 'USERS_'
BEGIN
 DECLARE @sql VARCHAR(MAX)

 SET @sql = 'ALTER TABLE [DBA_MESSAGENT].[' + @objname + '] ALTER COLUMN [MAIL] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL'
 EXECUTE (@sql)

 SET @sql = 'ALTER TABLE [DBA_MESSAGENT].[' + @objname + '] ADD [FIRSTNAME] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL'
 EXECUTE (@sql)

 SET @sql = 'ALTER TABLE [DBA_MESSAGENT].[' + @objname + '] ADD [LANG] [nvarchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL'
 EXECUTE (@sql)

 SET @sql = 'ALTER TABLE [DBA_MESSAGENT].[' + @objname + '] ADD [DATECREATION] [datetime] NOT NULL CONSTRAINT [DF_' + @objname + '_DATECREATION]  DEFAULT (getdate())'
 EXECUTE (@sql)

 SET @sql = 'ALTER TABLE [DBA_MESSAGENT].[' + @objname + '] ADD [DATEMODIFIED] [datetime] NOT NULL CONSTRAINT [DF_' + @objname + '_DATEMODIFIED]  DEFAULT (getdate())'
 EXECUTE (@sql)

 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test1@tester.be'', ''Van Gilbergen (Dutch Text Only)'', 1, 0, ''Ken'', ''NL'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test1@tester.be'', ''Van Gilbergen (Dutch)'', 1, 1, ''Ken'', ''NL'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test1@tester.be'', ''Van Gilbergen (French)'', 1, 1, ''Ken'', ''FR'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test1@tester.be'', ''Van Gilbergen (English)'', 1, 1, ''Ken'', ''EN'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test2@tester.be'', ''Rotthier (Dutch Text Only)'', 1, 0, ''Maarten'', ''NL'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test2@tester.be'', ''Rotthier (Dutch)'', 1, 1, ''Maarten'', ''NL'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test2@tester.be'', ''Rotthier (French)'', 1, 1, ''Maarten'', ''FR'')'
 EXECUTE (@sql)
 SET @sql = 'INSERT INTO [DBA_Messagent].[' + @objname + '] ([MAIL],[NAME],[TESTUSER],[ONLY_TEXT],[FIRSTNAME],[LANG]) VALUES (''test2@tester.be'', ''Rotthier (English)'', 1, 1, ''Maarten'', ''EN'')'
 EXECUTE (@sql)

 SET @sql = 'CREATE TRIGGER [DBA_MESSAGENT].[trig_update_' + @objname + '] ON  [DBA_MESSAGENT].[' + @objname + '] AFTER UPDATE AS
BEGIN
 SET NOCOUNT ON;
 IF NOT UPDATE(DATEMODIFIED)
    BEGIN
        UPDATE [DBA_MESSAGENT].[' + @objname + ']
  SET DATEMODIFIED=getdate()
        FROM [DBA_MESSAGENT].[' + @objname + '] INNER JOIN deleted d ON [DBA_MESSAGENT].[' + @objname + '].id = d.id
    END
END'
 EXECUTE (@sql)

 --PRINT @sql
END


GO

SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO

DISABLE TRIGGER [ddltrg_CREATE_TABLE] ON DATABASE
GO

ENABLE TRIGGER [ddltrg_CREATE_TABLE] ON DATABASE
GO
 

Debug agents on different databases 

Categories: Messagent

De verchillende agents moeten in apparte folders zitten met een instance.ini bestand.
 

Die instance.ini bevat MAILAGENT voor de instance MAILAGENT, CAMPAIGNAGENT voor de instance CAMPAIGNAGENT, ...
 

De messagent.ini zou zo eruit zien :

[MAILAGENT]
DSN="DRIVER={SQL Server};DATABASE=messagent;SERVER=XXX.XXX.XXX.XXX;UID=DBA_MESSAGENT_MAILAGENT;PWD=XXXX"
LOGPATH=D:\Messagent\_logfiles\
DEBUG=TRUE
[CAMPAIGNAGENT]
DSN="DRIVER={SQL Server};DATABASE=messagent;SERVER=XXX.XXX.XXX.XXX;UID=DBA_MESSAGENT_CAMPAIGNAGENT;PWD=XXXX"
LOGPATH=D:\Messagent\_logfiles\
DEFAULT_URL=http://www.optizen.be
DEBUG=TRUE
...

 

De DBA_MESSAGENT_XXX logins moeten dbo owner rechten op de messagent Database hebben.

Maar eerste moet je de huidige services uninstallen (eg. mailagent -u)

Dan dat alles configureren en dan mailagent -i.

Zorg er zeker voor dat elke service slechts eenmaal draait en gebruik dit enkel in development !

Page 35 of 43 << < 20 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 > >>