Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
11/10/2012 3:59:43 AM
Gravatar
Total Posts 22

Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

When I run this page (as site admin, from the root as required), I receive the following error message:

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'List' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 79: }
Line 80:
Line 81: List<string[]> data = new List<string[]>.List();
Line 82:
Line 83: if (letterInfo.LetterInfoGuid != null)

Source File: [server wwwroot]\NewsLetterImportUtil.aspx Line: 81

Show Detailed Compiler Output:

Version Information: Microsoft .NET Framework Version:2.0.50727.4223; ASP.NET Version:2.0.50727.4223

I am using MojoPortal v2.3.4.3 on Windows, hosted with GoDaddy.

Do I have to configure the NewsLetterImportUtil.aspx file in order to get it to work on v2.3.4.3?  

Is there a simple way to use the SQL Server Management Console to add the subscribers to the newsletter?

Any help is appreciated. Speedy help more so.

- /\dobe \/\/an

11/10/2012 8:27:15 AM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

P.S. I added the ".List" before the "()" at the end of line 81 because Visual Studio showed that as the proper syntax when I highlighted the "List" at the beginning of that method, stating:

List<string[]>.List() (+ 2 overload(s))

Initializes a new instance of the System.Collections.Generic.List<T> class that is empty and has the default initial capacity

...which had no effect and still produced the same "The type or namespace name 'List' could not be found" error.

 

- /\dobe \/\/an

11/10/2012 9:43:41 AM
Gravatar
Total Posts 18439

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

Strange, I don't get that error. I would think it could be solved by adding:

<%@ Import Namespace="System.Collections.Generic" %>

Best,

Joe

11/10/2012 9:51:37 AM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

That fixed the original error; however, I'm now getting:

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0103: The name 'data' does not exist in the current context

Source Error:

Line 104: {
Line 105: row = line.Split(',');
Line 106: data.Add(row);
Line 107: }
Line 108: }

Source File: [server wwwroot]\NewsLetterImportUtil.aspx Line: 106

- /\dobe \/\/an

11/10/2012 9:57:26 AM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

I tried loading the file onto my local copy of the website (also running MojoPortal v2.3.4.3 on Windows IIS 7.0), and I get no errors...

Could it be a trust level issue?

 

- /\dobe \/\/an

11/10/2012 10:11:29 AM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

Okay I accidentally commented out the original line 81 on the online copy. Un-commenting it corrects the issue. All users imported and verified. THANKS AGAIN JOE!!!

Something I found while doing this...

***WARNING***

If your .csv has any extra commas at the end of each line, it will proceed and give you the results of "Done! 0 Added, 0 Removed, 0 Failed (check the log)"

If you use Microsoft Excel to modify a spreadsheet, and you delete unwanted columns and save as a .csv file, Excel will not strip out those extra commas. Load your .csv file into Notepad to verify that each line contains ONLY
"+,[email_address]"

***END WARNING***

- /\dobe Wan

11/10/2012 11:50:22 AM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

Can the "NewsLetterImportUtil.aspx" file be updated to create a GUID for each imported user?

Currently all users imported using this method are assigned a UserGuid of "00000000-0000-0000-0000-000000000000".

All outbound messages require inclusion of "#unsubscribe#" somewhere in the newsletter; however...

Any user created by this method receives "No valid unsubscribe parameters provided" if they click on the unsubscribe link created in the newsletter. I assume that it's checking for the existence of a non-zero GUID, otherwise ANYBODY clicking the unsubscribe link would take EVERYBODY off of the list imported using the "NewsLetterImportUtil.aspx" tool (since they all have the same GUID).

 

Is there a way in SQL Server Management Studio to update all existing "00000000-0000-0000-0000-000000000000" UserGuids so they have a valid and unique GUID?

 

- /\dobe \/\/an

11/10/2012 11:59:36 AM
Gravatar
Total Posts 18439

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

UserGuid represents a relationship to the mp_Users table UserGuid column. Only site members have or need a UserGuid, a person can sign up for the newsletter without registering on the site and in that case has an empty guid for UserGuid (ie 00000000-0000-0000-0000-000000000000 is the same as Guid.Empty). If a user signs up for the newsletter and later registers on the site with the same email address it should automatically update the subscriber record with the new UserGuid.

The import utility does not import site members, it only imports email lists for the newsletter. It does however check if a SiteUser already exists for the email address and if so it uses the UserGuid for the site user to connect the subscription to the user.

There is no reason to have anything other than empty guid for the UserGuid if the user is not registered on the site.

Hope that helps,

Joe

11/10/2012 12:02:07 PM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

Got it.

I used the following script to generate unique GUIDs for each subscriber that was imported with a UserGuid of "00000000-0000-0000-0000-000000000000":

UPDATE dbo.mp_LetterSubscribe

SET UserGuid = replace(UserGuid, '00000000-0000-0000-0000-000000000000', GUID)

WHERE UserGuid LIKE '00000000-0000-0000-0000-000000000000';

Tested and verified.

 

- /\dobe \/\/an

11/10/2012 12:06:24 PM
Gravatar
Total Posts 22

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

There is no way for an imported subscriber to unsubscribe unless they have a unique GUID. (I tested it, and it gave me the above error "No valid unsubscribe parameters provided" when trying to unsubscribe using an imported email with an all-zero GUID.)

Will a subsequent site registration replace the GUID if there's something (non-zero GUID) already in the UserGuid column of dbo.mp_LetterSubscribe?

 

- /\dobe \/\/an

11/10/2012 12:07:22 PM
Gravatar
Total Posts 18439

Re: Newsletter Import Subscribers Utility (NewsLetterImportUtil.aspx)

You are right that there is a bug in the plain text email token replacement for unsubscribe, if the UserGuid is empty it should use SubscribeGuid as the Html email token replacement does. I just fixed in my copy so it will be fixed in the next release, but most people will subscribe to the html rather than plain text anyway and it is working correctly there. When importing users I would opt them into the html email not plain text since the html newsletter is a much better marketing mechanism than a plain text email.

A subscriber should not need a UserGuid to unsubscribe.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.