Exemplo n.º 1
0
        /// <summary>
        /// Adds parameters to <paramref name="link"/>.
        /// </summary>
        /// <param name="link">Source link.</param>
        /// <returns>Modified link.</returns>
        private static string AddParametersToLink(string link)
        {
            var parameters = new Dictionary <string, string> {
                { ContactIdParameterName, GetFormattedMacros(ContactIdMacrosName) },
                { BulkEmailRecipientIdParameterName, GetFormattedMacros(BulkEmailRecipientIdName) }
            };

            return(BulkEmailUriHelper.AddParametersToUri(link, parameters));
        }
        private static Select BuildRIdSelect(UserConnection userConnection, Guid bulkEmailId, string preparedUrl)
        {
            var uriTrackingParams =
                BulkEmailUriHelper.GetParametersFromUri(preparedUrl, UrlTrackIdParameterName,
                                                        UrlReplicaMaskParameterName);
            var rIdSelect = new Select(userConnection)
                            .Column("RId")
                            .From("BulkEmailHyperlink");

            if (uriTrackingParams.ContainsKey(UrlTrackIdParameterName) &&
                int.TryParse(uriTrackingParams[UrlTrackIdParameterName], out int trackId) &&
                uriTrackingParams.ContainsKey(UrlReplicaMaskParameterName) &&
                long.TryParse(uriTrackingParams[UrlReplicaMaskParameterName], out long replicaMask))
            {
                rIdSelect = AppendWhereCloseByTrackingParams(bulkEmailId, trackId, replicaMask, rIdSelect);
            }
            else
            {
                rIdSelect = AppendWhereClauseByHash(bulkEmailId, preparedUrl, rIdSelect);
            }
            rIdSelect.SpecifyNoLockHints();
            return(rIdSelect);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Removes utm parameters from url.
 /// </summary>
 /// <param name="url">Url.</param>
 /// <returns>Url.</returns>
 public static string RemoveUtmFromUri(string url)
 {
     return(BulkEmailUriHelper.RemoveParametersFromUri(url, EmailRIdParameterName, "utm_source",
                                                       "utm_campaign", "utm_term", "utm_content", "utm_medium"));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Removes extra parameters (contactId and bulkEmailRecipientId) from the uri.
 /// </summary>
 /// <param name="sourceUri">Uri.</param>
 /// <returns>Uri.</returns>
 public static string RemoveExtraParametersFromUri(string sourceUri)
 {
     return(BulkEmailUriHelper.RemoveParametersFromUri(sourceUri, ContactIdParameterName,
                                                       BulkEmailRecipientIdParameterName));
 }